Show loading indicator when video is buffering (#1441)
## Description Shows a loading indicator and slightly dim the screen when playback is buffering. Showing the indicator is delayed in case the buffering doesn't take very long. Dev note: the changes to `MpvPlayer` need to be ported to wholphin-extensions as well. ### Related issues Closes #1411 ### Testing Emulator ## Screenshots [buffering.webm](https://github.com/user-attachments/assets/dd848696-d6de-4f68-94e4-901bb5db1185) ## AI or LLM usage None
This commit is contained in:
parent
903c45dfb8
commit
8177700e23
4 changed files with 87 additions and 2 deletions
|
|
@ -620,6 +620,16 @@ class MpvPlayer(
|
|||
}
|
||||
notifyListeners(EVENT_IS_PLAYING_CHANGED) { onIsPlayingChanged(!value) }
|
||||
}
|
||||
|
||||
MPVProperty.PAUSED_FOR_CACHE -> {
|
||||
Timber.v("paused-for-cache %s", value)
|
||||
playbackState.update {
|
||||
it.copy(
|
||||
state = if (value) STATE_BUFFERING else it.state,
|
||||
)
|
||||
}
|
||||
notifyListeners(EVENT_PLAYBACK_STATE_CHANGED) { onPlaybackStateChanged(playbackState.load().state) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue