Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qml video looping support

Qml video looping support

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 4 Posters 7.4k 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.
  • Q Offline
    Q Offline
    qtnext
    wrote on last edited by
    #1

    Hi,

    I need to have a video looping smoothly for the background of my qml desktop application (windows, directshow). It seems that there is no loop support... I have tryed to restart the media at the end, use playlist but I have a very big loop time (normal, the video is closed then reopen!) Has anyone find a workaround to that ... the only one I have finded is to rewrite from scratch a video backend !

    1 Reply Last reply
    0
    • W Offline
      W Offline
      wickwire
      wrote on last edited by
      #2

      Hi, same problem here, on Qt5:

      I'm trying to loop a video with MediaPlayer and VideoOutput elements and found a way to do it:
      @
      MediaPlayer {
      id: mediaplayer
      source: previewVideo
      autoPlay: true
      loops: Animation.Infinite
      }

          VideoOutput {
          id: previewvid
          anchors.fill: parent
          source: mediaplayer
          visible: false
          }
      

      @

      There is however a split-second change when the video reloads, and I can see the background - I think that by adding a rectangle in the background it might work...

      1 Reply Last reply
      0
      • K Offline
        K Offline
        karulis
        wrote on last edited by
        #3

        I have similar requiroment to play video in smooth loop.

        I have tried solution from answer but I also see this gap between loops which is not acceptable.

        I have also tried to make part of longer video to loop at some point(by using qml timer and moving position of media player to beginning of loop when timer is triggered), but in that case there is noticible freez of video when changing the position.

        Is there any other solution to that.
        Or I will just have to implement it directly in Qt/C++?

        1 Reply Last reply
        0
        • martin_kyM Offline
          martin_kyM Offline
          martin_ky
          wrote on last edited by
          #4

          I don't think smooth looping is functionality is implemented in QML.

          I am also interested in this functionality. In theory, there is a C++ class that should provide this function - "QMediaGaplessPlaybackControl":http://qt-project.org/doc/qt-5/qmediagaplessplaybackcontrol.html. It's on my TODO list to try it some day. Has anyone any experience with it?

          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