QmediaPlaylist replacement in Qt6.4.2
-
Hello, everyone!
Since QMediaPlaylist was removed in Qt6, I would like to find a simple way to replace it. I know that it is somehow included in the "player" example, but at first see it is too much and too big. So what I want is a QMediaPlayer with multiple videos like QMediaPlaylist did.
Thank you for the help! -
That class has been put in the media player example.
Otherwise, if it's just a list of files you want to manage, you can have a QStringList with the paths of these files and trigger the reading of the next one once the current finishes.
-
Hi,
From a quick look, the original classes have been used in that example.
Depending on your needs, a simple alternative would be to use a QStringList do hold the paths to your media and loop through it. You can use a QStringListModel to with a QListView on top to show the list.
-
@Kaguro I found fast solution:
QMediaPlayer player_; QAudioOutput* audioOutput = new QAudioOutput(&player_); player_.setAudioOutput(audioOutput); player_.setSource(QUrl::fromLocalFile("pathToFile/music.mp3")); audioOutput->setVolume(50); player_.play();
-
That class has been put in the media player example.
Otherwise, if it's just a list of files you want to manage, you can have a QStringList with the paths of these files and trigger the reading of the next one once the current finishes.
-
K Kaguro has marked this topic as solved