PDA

View Full Version : wildcards with phonon video player



prophet0
4th November 2011, 09:49
QString vidpath = QApplication::applicationDirPath();
vidpath = "/home/development/videos/";
QString filepath = QApplication::applicationFilePath();
filepath = "*.avi";
ui->videoPlayer->load(Phonon::MediaSource(vidpath + filepath));



I get this error



PHONON-GST BEGIN: Phonon::Gstreamer::StreamReader::StreamReader(cons t Phonon::MediaSource&, Phonon::Gstreamer::MediaObject*)
PHONON-GST END__: Phonon::Gstreamer::StreamReader::StreamReader(cons t Phonon::MediaSource&, Phonon::Gstreamer::MediaObject*) [Took: 0s]
PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::start()
PHONON-GST END__: void Phonon::Gstreamer::StreamReader::start() [Took: 0s]
PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::stop()
PHONON-GST END__: void Phonon::Gstreamer::StreamReader::stop() [Took: 0s]
PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::start()
PHONON-GST END__: void Phonon::Gstreamer::StreamReader::start() [Took: 0s]
PHONON-GST BEGIN: GstFlowReturn Phonon::Gstreamer::StreamReader::read(quint64, int, char*)
Touch Taxi(9938): couldn't create slave: "Unable to create io-slave:
klauncher said: Unknown protocol ''.
"
PHONON-GST BEGIN: virtual void Phonon::Gstreamer::StreamReader::endOfData()
PHONON-GST END__: virtual void Phonon::Gstreamer::StreamReader::endOfData() [Took: 0s]
PHONON-GST END__: GstFlowReturn Phonon::Gstreamer::StreamReader::read(quint64, int, char*) [Took: 0.012s]
PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::unlock()
PHONON-GST END__: void Phonon::Gstreamer::StreamReader::unlock() [Took: 0s]
PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::stop()
PHONON-GST END__: void Phonon::Gstreamer::StreamReader::stop() [Took: 0s]
Touch Taxi(9938): couldn't create slave: "Unable to create io-slave:
klauncher said: Unknown protocol ''.
"
PHONON-GST BEGIN: virtual void Phonon::Gstreamer::StreamReader::endOfData()
PHONON-GST END__: virtual void Phonon::Gstreamer::StreamReader::endOfData() [Took: 0s]
PHONON-GST BEGIN: virtual Phonon::Gstreamer::StreamReader::~StreamReader()
PHONON-GST END__: virtual Phonon::Gstreamer::StreamReader::~StreamReader() [Took: 0s]



but if i change the above code to this it works




QString vidpath = QApplication::applicationDirPath();
vidpath = "/home/development/videos/";
QString filepath = QApplication::applicationFilePath();
filepath = "myvid.avi"; //changed to just 1 file from that folder
ui->videoPlayer->load(Phonon::MediaSource(vidpath + filepath));



yes i have searched google for about 3 days with different scenarios and still have had no success

i am new to qt and been working with it everyday all day for about 3 months trying to learn and troubleshoot problems this is one problem a cant seem to fix on my own

what im trying to accomplish here is playing all files in the folder vidpath with any file that ends with .avi if there is a better solution please point me in that direction hope this is not a total newbie question i been beating my head off the wall for days now trying to get this to work

thanks

prophet0
7th November 2011, 12:43
Anyone know a solution?

MrShahi
20th January 2012, 13:55
QString vidpath = QApplication::applicationDirPath();
vidpath = "/home/development/videos/";
QString filepath = QApplication::applicationFilePath();
filepath = "*.avi";
ui->videoPlayer->load(Phonon::MediaSource(vidpath + filepath));


To play multiple media file in a sequence , you need to create Phonon::MediaObject
like this
/*********/
Phonon::MediaObject *metaInformationResolver;
QStringList files = QFileDialog::getOpenFileNames(this, tr("Select Music Files"),
QDesktopServices::storageLocation(QDesktopServices ::MusicLocation));

if (files.isEmpty())
return;

int index = sources.size();
foreach (QString string, files) {
Phonon::MediaSource source(string);

sources.append(source);
}
if (!sources.isEmpty())
metaInformationResolver->setCurrentSource(sources.at(index));

/********************************************/
This code is taken from qmusicplayer example
I hope this will help you..