Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QmediaPlaylist replacement in Qt6.4.2
QtWS25 Last Chance

QmediaPlaylist replacement in Qt6.4.2

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kaguro
    wrote on 15 Dec 2023, 12:41 last edited by
    #1

    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!

    B 1 Reply Last reply 8 Mar 2024, 11:07
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 23 Mar 2025, 19:36 last edited by
      #5

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply 24 Mar 2025, 07:55
      1
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 16 Dec 2023, 20:31 last edited by
        #2

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • K Kaguro
          15 Dec 2023, 12:41

          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!

          B Offline
          B Offline
          baziorek
          wrote on 8 Mar 2024, 11:07 last edited by
          #3

          @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();
          
          K 1 Reply Last reply 23 Mar 2025, 08:24
          0
          • B baziorek
            8 Mar 2024, 11:07

            @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();
            
            K Offline
            K Offline
            Kaguro
            wrote on 23 Mar 2025, 08:24 last edited by
            #4

            @baziorek Hi!
            This is just for exactly one mp3 file, what I would like achive is a QMediaPlaylist like in Qt5.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 23 Mar 2025, 19:36 last edited by
              #5

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              K 1 Reply Last reply 24 Mar 2025, 07:55
              1
              • S SGaist
                23 Mar 2025, 19:36

                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 Offline
                K Offline
                Kaguro
                wrote on 24 Mar 2025, 07:55 last edited by
                #6

                @SGaist Thanks! Thats will be the solution!

                1 Reply Last reply
                0
                • K Kaguro has marked this topic as solved on 24 Mar 2025, 07:55

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved