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::CurrentItemOnce not producing the required result
Forum Updated to NodeBB v4.3 + New Features

QMediaPlaylist::CurrentItemOnce not producing the required result

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 807 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Allaye
    wrote on last edited by Allaye
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Then why not use QMediaPlaylist::Sequential ?

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

      A 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Then why not use QMediaPlaylist::Sequential ?

        A Offline
        A Offline
        Allaye
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you show the code you are currently using ? And describe the procedure you follow that you say is not working as expected ?

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

          A 1 Reply Last reply
          0
          • SGaistS SGaist

            Can you show the code you are currently using ? And describe the procedure you follow that you say is not working as expected ?

            A Offline
            A Offline
            Allaye
            wrote on last edited by
            #5

            @SGaist

            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

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by SGaist
              #6

              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:

              https://code.woboq.org/qt5/qtmultimedia/src/multimedia/playback/qmediaplaylistnavigator.cpp.html#_ZNK30QMediaPlaylistNavigatorPrivate11nextItemPosEi

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

              A 1 Reply Last reply
              0
              • SGaistS SGaist

                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:

                https://code.woboq.org/qt5/qtmultimedia/src/multimedia/playback/qmediaplaylistnavigator.cpp.html#_ZNK30QMediaPlaylistNavigatorPrivate11nextItemPosEi

                A Offline
                A Offline
                Allaye
                wrote on last edited by
                #7

                @SGaist okay will try and see how good it works out

                1 Reply Last reply
                0

                • Login

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