import QtQuick 2.7
import QtQuick.Controls 2.0
import QtMultimedia 5.8
ApplicationWindow {
visible: true
width: 640
height: 480
property bool flip: true
Timer {
interval: 5000
running: true
repeat: true
onTriggered: {
flip = !flip
if(flip) {
videoOutput.source = null
} else {
videoOutput.source = player
}
}
}
VideoOutput {
id: videoOutput
anchors.fill: parent
source: player
}
MediaPlayer {
id: player
source: "file://video.mp4"
autoPlay: true
loops: MediaPlayer.Infinite
}
}
在将Timer
设置为videoOutput.source
的{{1}}触发后,它将再次无效。 null
只会对先前解码过的帧进行过时的绘制,并且永远不会改变。