Fixes "Pause with one click" for MPV (#701)

## Description
Fixes "Pause with one click" so the desired behavior isn't reversed and
now shows the controls when pausing.

This bug happened because MPV commands are async, so there is a tiny
delay before the pausing occurs and the playback state is updated.
However, the logic to decided whether to show the controls or not checks
the playback state immediately.

### Related issues
Fixes #697
This commit is contained in:
Ray 2026-01-14 17:06:40 -05:00 committed by GitHub
parent d725821011
commit 3215326515
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -45,8 +45,9 @@ class PlaybackKeyHandler(
player.seekForward(seekForward) player.seekForward(seekForward)
updateSkipIndicator(seekForward.inWholeMilliseconds) updateSkipIndicator(seekForward.inWholeMilliseconds)
} else if (oneClickPause && isEnterKey(it)) { } else if (oneClickPause && isEnterKey(it)) {
val wasPlaying = player.isPlaying
Util.handlePlayPauseButtonAction(player) Util.handlePlayPauseButtonAction(player)
if (!player.isPlaying) { if (wasPlaying) {
controllerViewState.showControls() controllerViewState.showControls()
} else { } else {
skipBackOnResume?.let { skipBackOnResume?.let {