Results 1 to 20 of 20

Thread: can't see a video play but only music in Qt

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2010
    Posts
    137
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default can't see a video play but only music in Qt

    Hi,

    I want to play a video in my application. But whenever I try to runt he application, I get the message "WARNING: Phonon::createPath: Cannot connect Phonon::MediaObject ( no objectName ) to Phonon::VideoWidget ( no objectName )." And I can hear the music but not video. Here is my code

    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::MainWindow)
    4. {
    5. ui->setupUi(this);
    6. Phonon::VideoPlayer *player =
    7. new Phonon::VideoPlayer(Phonon::VideoCategory, this);
    8. player->play(QUrl("path"));
    9. player->show();
    10. }
    11.  
    12. #include <QMainWindow>
    13. #include <phonon/VideoPlayer>
    14. #include <phonon/backendcapabilities.h>
    15. #include <QUrl>
    16. #include <phonon>
    17. namespace Ui {
    18. class MainWindow;
    19. }
    20.  
    21. class MainWindow : public QMainWindow
    22. {
    23. Q_OBJECT
    24.  
    25. public:
    26. explicit MainWindow(QWidget *parent = 0);
    27. ~MainWindow();
    28.  
    29. private:
    30. Ui::MainWindow *ui;
    31. };
    To copy to clipboard, switch view to plain text mode 

    I tried to run the code from http://www.qtcentre.org/threads/3048...w-black-screen but didn't work. Can any one please tell me what else should be required to play a video.

    Thank You,
    Baluk
    Last edited by baluk; 8th October 2010 at 13:30.

Similar Threads

  1. play a video from youtube
    By graciano in forum Qt Programming
    Replies: 2
    Last Post: 13th July 2011, 07:17
  2. How to reverse play a video with phonon
    By Markus in forum Qt Programming
    Replies: 1
    Last Post: 19th July 2010, 06:48
  3. Qt phonon is only giving black screen when i play the video.what can be the soluition
    By savaliya_ambani in forum Qt for Embedded and Mobile
    Replies: 6
    Last Post: 3rd July 2010, 13:09
  4. Play video file with Phonon and GStreamer show black screen
    By SimbadSubZero in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2010, 11:47
  5. Play video in QT4 application
    By carlosmele in forum Qt Programming
    Replies: 3
    Last Post: 14th April 2009, 22:24

Tags for this Thread

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.