mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-24 03:36:51 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user