Unsolved QMediaPlaylist::CurrentItemOnce not producing the required result
-
Am trying to implement the media loop mechanism, i wanted the current video to continue playing which it does but i cant next to the other media, it always come back to the current media.. any help pls
-
Hi,
Then why not use
QMediaPlaylist::Sequential
? -
yea i used QMediaPlaylist::Sequential and it works but that not what i want, i want to be able to play a particular media from the playlist and stop
-
Can you show the code you are currently using ? And describe the procedure you follow that you say is not working as expected ?
-
void MediaApp::on_actionRepeat_triggered() { mpl->setPlaybackMode(QMediaPlaylist::PlaybackMode::CurrentItemOnce); ui.actionRepeat->setIcon(QIcon(":/MediaApp/Resources/onceloop.png")); ui.actionRepeat->setToolTip("Play This Media Only Once And Stop"); } void MediaApp::on_actionNext_triggered() { ui.statusBar->clearMessage(); ui.statusBar->showMessage("Next Media Playing......", 20000); mpl->next(); mp->play(); }
when i click on the Repeat button it is suppose to play the media once and stop which it does, but after clicking the repeat button i cant play the next media in the playlist it always repeat the current media it wont NEXT to the next media . that is the problem with the code
-
Taking a look at the documentation of nextIndex which is called by next, it's not unexpected. Looking at the implementation, it's exactly what is happening.
So if you want to go to the next item, change the playback mode, call next and put back the original playback mode.
For the gory details see:
-
@SGaist okay will try and see how good it works out