0

I'm trying to loop a video on the background of my Pyside6 application, currently implementing it through QML.

Everything works fine so far, but I've noticed the media player clears the screen for a moment before actually repeating the video.

I've seen it was possible to workaround this issue by using a property called "flushMode" in the old Qt5 QtMultimedia, but said property seems to have disappeared in Qt6 (or maybe it's just not implemented yet, I don't know).

I was wondering if there is any other way to make a seamless smooth video loop in QtMultimedia 6.2 (using QML, since my app is running on Python).

This is what I have so far (the media player is separated from the main app because of reasons):

import QtQuick
import QtMultimedia

Rectangle {

    id: playVid2
    anchors.left: parent.left
    anchors.right: parent.right
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    anchors.rightMargin: 0
    anchors.leftMargin: 0
    anchors.bottomMargin: 0
    anchors.topMargin: 0

    MediaPlayer {
        id: mpVid2
        audioOutput: AudioOutput{}
        videoOutput: voVid2
        source: "media/video/2.mp4"
        loops: MediaPlayer.Infinite
    }

    VideoOutput {
        id: voVid2
        anchors.fill: parent
        fillMode: VideoOutput.PreserveAspectCrop
        
    }

    Component.onCompleted: mpVid2.play()
}
Seifu
  • 9
  • 1
  • 1
    I think that implementing this logic from QML is unnecessarily complicated, it is better to report an issue requesting that this property be reintroduced, seeing the source code of Qt5 I do not see that it is so complicated to add it. – eyllanesc Nov 17 '21 at 18:10
  • 1
    Yeah it would be nice if they looked into it in future updates. Actually it may already be in their plans since it was actually a feature in previous versions. Thanks for your response, eyllanesc :') – Seifu Nov 17 '21 at 20:47

0 Answers0