feat: implement quick play/pause toggle for TV player

Adds the ability to play and pause media using the Center or Enter keys
without displaying the full player controls. When pausing via this
method, a brief visual "Pause" feedback overlay is shown in the center
of the screen.

- Added `TvPlayerHiddenStopFeedback` component and related logic
- Updated `handleTvPlayerRootKeyEvent` to support background playback toggling
- Added `pausePlayback` and `resumePlayback` to `PlayerViewModel` and `PlayerManager`
- Included comprehensive UI tests for the new hidden control behavior
This commit is contained in:
2026-04-12 19:02:45 +02:00
parent 16839942b1
commit a0af187e8f
4 changed files with 299 additions and 3 deletions

View File

@@ -139,6 +139,18 @@ class PlayerManager @Inject constructor(
if (player.isPlaying) player.pause() else player.play()
}
fun pausePlayback() {
if (player.isPlaying) {
player.pause()
}
}
fun resumePlayback() {
if (!player.isPlaying) {
player.play()
}
}
fun seekTo(positionMs: Long) {
val target = clampSeekPosition(positionMs)
pendingSeekPositionMs = target

View File

@@ -188,6 +188,14 @@ class PlayerViewModel @Inject constructor(
showControls(autoHideDelayMs)
}
fun pausePlayback() {
playerManager.pausePlayback()
}
fun resumePlayback() {
playerManager.resumePlayback()
}
fun seekTo(positionMs: Long) {
playerManager.seekTo(positionMs)
}