Results 1 to 3 of 3

Thread: wildcards with phonon video player

  1. #1
    Join Date
    Oct 2011
    Location
    Toronto Canada
    Posts
    97
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default wildcards with phonon video player

    Qt Code:
    1. QString vidpath = QApplication::applicationDirPath();
    2. vidpath = "/home/development/videos/";
    3. QString filepath = QApplication::applicationFilePath();
    4. filepath = "*.avi";
    5. ui->videoPlayer->load(Phonon::MediaSource(vidpath + filepath));
    To copy to clipboard, switch view to plain text mode 

    I get this error

    Qt Code:
    1. PHONON-GST BEGIN: Phonon::Gstreamer::StreamReader::StreamReader(const Phonon::MediaSource&, Phonon::Gstreamer::MediaObject*)
    2. PHONON-GST END__: Phonon::Gstreamer::StreamReader::StreamReader(const Phonon::MediaSource&, Phonon::Gstreamer::MediaObject*) [Took: 0s]
    3. PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::start()
    4. PHONON-GST END__: void Phonon::Gstreamer::StreamReader::start() [Took: 0s]
    5. PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::stop()
    6. PHONON-GST END__: void Phonon::Gstreamer::StreamReader::stop() [Took: 0s]
    7. PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::start()
    8. PHONON-GST END__: void Phonon::Gstreamer::StreamReader::start() [Took: 0s]
    9. PHONON-GST BEGIN: GstFlowReturn Phonon::Gstreamer::StreamReader::read(quint64, int, char*)
    10. Touch Taxi(9938): couldn't create slave: "Unable to create io-slave:
    11. klauncher said: Unknown protocol ''.
    12. "
    13. PHONON-GST BEGIN: virtual void Phonon::Gstreamer::StreamReader::endOfData()
    14. PHONON-GST END__: virtual void Phonon::Gstreamer::StreamReader::endOfData() [Took: 0s]
    15. PHONON-GST END__: GstFlowReturn Phonon::Gstreamer::StreamReader::read(quint64, int, char*) [Took: 0.012s]
    16. PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::unlock()
    17. PHONON-GST END__: void Phonon::Gstreamer::StreamReader::unlock() [Took: 0s]
    18. PHONON-GST BEGIN: void Phonon::Gstreamer::StreamReader::stop()
    19. PHONON-GST END__: void Phonon::Gstreamer::StreamReader::stop() [Took: 0s]
    20. Touch Taxi(9938): couldn't create slave: "Unable to create io-slave:
    21. klauncher said: Unknown protocol ''.
    22. "
    23. PHONON-GST BEGIN: virtual void Phonon::Gstreamer::StreamReader::endOfData()
    24. PHONON-GST END__: virtual void Phonon::Gstreamer::StreamReader::endOfData() [Took: 0s]
    25. PHONON-GST BEGIN: virtual Phonon::Gstreamer::StreamReader::~StreamReader()
    26. PHONON-GST END__: virtual Phonon::Gstreamer::StreamReader::~StreamReader() [Took: 0s]
    To copy to clipboard, switch view to plain text mode 

    but if i change the above code to this it works

    Qt Code:
    1. QString vidpath = QApplication::applicationDirPath();
    2. vidpath = "/home/development/videos/";
    3. QString filepath = QApplication::applicationFilePath();
    4. filepath = "myvid.avi"; //changed to just 1 file from that folder
    5. ui->videoPlayer->load(Phonon::MediaSource(vidpath + filepath));
    To copy to clipboard, switch view to plain text mode 

    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
    Last edited by prophet0; 4th November 2011 at 09:10.

  2. #2
    Join Date
    Oct 2011
    Location
    Toronto Canada
    Posts
    97
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: wildcards with phonon video player

    Anyone know a solution?

  3. #3
    Join Date
    Jan 2008
    Posts
    72
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: wildcards with phonon video player

    Qt Code:
    1. QString vidpath = QApplication::applicationDirPath();
    2. vidpath = "/home/development/videos/";
    3. QString filepath = QApplication::applicationFilePath();
    4. filepath = "*.avi";
    5. ui->videoPlayer->load(Phonon::MediaSource(vidpath + filepath));
    To copy to clipboard, switch view to plain text mode 
    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..

Similar Threads

  1. Replies: 4
    Last Post: 28th December 2010, 04:13
  2. how to set duration of a video in a video player in qt
    By qt_user in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2010, 10:51
  3. Phonon Video Player Problem...
    By emrez in forum Qt Programming
    Replies: 0
    Last Post: 14th July 2010, 14:26
  4. Phonon Video Player + XML
    By igor.schkrab in forum Qt Programming
    Replies: 0
    Last Post: 24th November 2009, 23:49
  5. Video freezes during mpeg video playback using Phonon
    By davejames in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2009, 08:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.