Please nominate your Qt Champions for 2021!

Qml video looping support

  • 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 !

  • 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...

  • 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++?

  • 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": It's on my TODO list to try it some day. Has anyone any experience with it?

Log in to reply