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.
  • KaguroK Offline
    KaguroK Offline
    Kaguro
    wrote on 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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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

      KaguroK 1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on 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
        • KaguroK Kaguro

          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 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();
          
          KaguroK 1 Reply Last reply
          0
          • B baziorek

            @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();
            
            KaguroK Offline
            KaguroK Offline
            Kaguro
            wrote on 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
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on 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

              KaguroK 1 Reply Last reply
              1
              • SGaistS SGaist

                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.

                KaguroK Offline
                KaguroK Offline
                Kaguro
                wrote on last edited by
                #6

                @SGaist Thanks! Thats will be the solution!

                1 Reply Last reply
                0
                • KaguroK Kaguro has marked this topic as solved on

                • Login

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