QMediaPlaylist::CurrentItemOnce not producing the required result
Unsolved
General and Desktop
-
Hi,
Then why not use
QMediaPlaylist::Sequential
? -
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: