QMediaPlayer and QVideoWidgets status

302 views Asked by At

How can I check the status of a QMedia object if it is running or not? I want to stop player as soon as I close my vw. There is the code for my player and vw :

 QMediaPlayer* player = new QMediaPlayer;
 QVideoWidget* vw = new QVideoWidget;

 player->setVideoOutput(vw);
 player->setMedia(QUrl("C:/Users/Hafiz/Documents/AddingVedio/HangManShot1.wmv"));
 vw->setGeometry(100,100,800,600);
 vw->show();
 player->play();

Thanks

0

There are 0 answers