Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Solved] Unable to display Video using Phonon



  • Dear All,

    I want to display a video on QWidget. For that, i am trying following code

    @QGridLayout *grid = new QGridLayout(this);
    grid->setSpacing(20);

    Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, this);
    
    grid->addWidget(player, 1, 0, 3, 1);
    
    player->play(Phonon::MediaSource("D:\\Himanshu\\Media\\Kailasa.mp4"));
    
    
    setLayout(grid);@
    

    I write this code in constructor of class. This code is compiling without any error. But, It does not display any video. Player is visible on widget but it is display in white color.

    Thnx in advance.


Log in to reply