1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 10:42:29 +01:00

Add slight delay to wait for MM to start outputting some frames

This commit is contained in:
Elias Steurer 2023-07-02 12:25:04 +02:00
parent 7abc937e0e
commit 7f230df175

View File

@ -33,12 +33,23 @@ Item {
mediaPlayer.play();
}
// Add slight delay to give the multimedia
// engine some time to put out some frames. This
// fixes some white frame flickering
Timer {
id: startTimer
interval: 50
onTriggered: {
Wallpaper.requestFadeIn();
}
}
MediaPlayer {
id: mediaPlayer
onPlaybackStateChanged: {
if (mediaPlayer.playbackState == MediaPlayer.PlayingState && !fadeInDone) {
fadeInDone = true;
Wallpaper.requestFadeIn();
startTimer.start()
}
}
loops: root.loops ? MediaPlayer.Infinite : 1
@ -85,7 +96,6 @@ Item {
}
function onVisualsPausedChanged(visualsPaused) {
print(visualsPaused)
if(!Wallpaper.isPlaying)
return
if(visualsPaused)