1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-06-26 11:33:50 +00:00

Update outdated PlaybackState enums in QML

With the refractor in f91e9f8, an abstraction over QtMultiMedia was
implemented. New enums for the PlaybackState were created, to not make
the application depend on QtMultiMedia. However, not all code was
updated to make proper use of these new enums.

This in turn caused the screen turned off while playing a video and the
HUD not showing when the video started buffering. This commit fixes
that.

Closes #51
This commit is contained in:
Chris Josten 2024-05-08 20:25:59 +02:00
parent 19efba457c
commit 5328e63e2c
2 changed files with 5 additions and 10 deletions

View file

@ -152,15 +152,10 @@ Item {
Connections {
target: manager
onMediaStatusChanged: {
console.log("New mediaPlayer status: " + manager.mediaStatus)
switch(manager.mediaStatus) {
case J.MediaStatus.Loaded:
case J.MediaStatus.Buffering:
show(false)
break;
case J.MediaStatus.Buffered:
if (manager.mediaStatus == J.MediaStatus.Loaded || manager.mediaStatus == J.MediaStatus.Buffered) {
hide(false)
break;
} else if (manager.mediaStatus == J.MediaStatus.Buffering || manager.mediaStatus == J.MediaStatus.Stalled) {
show(false)
}
}
}

View file

@ -131,11 +131,11 @@ ApplicationWindow {
// Keep the sytem alive while playing media
KeepAlive {
enabled: playbackManager.playbackState === MediaPlayer.PlayingState
enabled: playbackManager.playbackState == PlayerState.Playing
}
DisplayBlanking {
preventBlanking: playbackManager.playbackState === MediaPlayer.PlayingState
preventBlanking: playbackManager.playbackState == PlayerState.Playing
&& playbackManager.hasVideo
&& playbackManager.controllingSessionLocal // Must be controlling a local session
}