Results 1 to 7 of 7

Thread: Phonon::VideoPlayer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Phonon::VideoPlayer

    Hi

    I'm new to Qt. I'm trying to get a Phonon::VideoPlayer running to playback an MPEG4 video. I have the VideoPlayer window displaying but the the video screen is just black and there is no video playback. I'm running this on Windows XP. My code is below, hope you can help.
    thanks
    Dano

    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent)
    2. : QMainWindow(parent), ui(new Ui::MainWindow)
    3. {
    4. ui->setupUi(this);
    5.  
    6. //setup media object
    7. //
    8. media = new Phonon::MediaObject();
    9. media->setCurrentSource(Phonon::MediaSource(QString("C:\\workspace\\sample_mpeg4.mp4")));
    10.  
    11. //setup player
    12. //
    13. videoPlayer = new Phonon::VideoPlayer(Phonon::VideoCategory);
    14. videoPlayer->setFixedSize(QSize(400,300));
    15. videoPlayer->move(1280-400,0);
    16. videoPlayer->show();
    17. connect(videoPlayer, SIGNAL(finished()), videoPlayer, SLOT(deleteLater()));
    18. videoPlayer->play(media->currentSource());
    19.  
    20. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by dano_labrosse; 17th October 2009 at 19:05.

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
  •  
Qt is a trademark of The Qt Company.