mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 18:35:05 +00:00
Keep tvOS player controls visible on pause via on-screen button
Route the on-screen play/pause button through handlePlayPause() so it follows the same visibility and auto-hide timer logic as the Siri Remote hardware button: timer stops when paused (controls stay pinned) and restarts on resume.
This commit is contained in:
@@ -21,6 +21,10 @@ struct TVPlayerControlsView: View {
|
|||||||
let onShowComments: () -> Void
|
let onShowComments: () -> Void
|
||||||
let onShowDebug: () -> Void
|
let onShowDebug: () -> Void
|
||||||
let onClose: () -> Void
|
let onClose: () -> Void
|
||||||
|
/// Called when the on-screen play/pause button is tapped. Parent routes
|
||||||
|
/// through `handlePlayPause()` so visibility/auto-hide timer behave
|
||||||
|
/// consistently with the Siri Remote's hardware Play/Pause button.
|
||||||
|
let onTogglePlayPause: () -> Void
|
||||||
/// Called when scrubbing state changes - parent should stop auto-hide timer when true
|
/// Called when scrubbing state changes - parent should stop auto-hide timer when true
|
||||||
var onScrubbingChanged: ((Bool) -> Void)?
|
var onScrubbingChanged: ((Bool) -> Void)?
|
||||||
/// Pending target time for the bar's accumulating remote-seek flow (arrow
|
/// Pending target time for the bar's accumulating remote-seek flow (arrow
|
||||||
@@ -269,7 +273,7 @@ struct TVPlayerControlsView: View {
|
|||||||
|
|
||||||
Button {
|
Button {
|
||||||
playPauseTapCount += 1
|
playPauseTapCount += 1
|
||||||
playerService?.togglePlayPause()
|
onTogglePlayPause()
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: playPauseIcon)
|
Image(systemName: playPauseIcon)
|
||||||
.font(.system(size: 32, weight: .semibold))
|
.font(.system(size: 32, weight: .semibold))
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ struct TVPlayerView: View {
|
|||||||
onShowComments: { showDetailsPanel(tab: .comments) },
|
onShowComments: { showDetailsPanel(tab: .comments) },
|
||||||
onShowDebug: { showDebugOverlay() },
|
onShowDebug: { showDebugOverlay() },
|
||||||
onClose: { closeVideo() },
|
onClose: { closeVideo() },
|
||||||
|
onTogglePlayPause: { handlePlayPause() },
|
||||||
onScrubbingChanged: { scrubbing in
|
onScrubbingChanged: { scrubbing in
|
||||||
isScrubbing = scrubbing
|
isScrubbing = scrubbing
|
||||||
if scrubbing {
|
if scrubbing {
|
||||||
|
|||||||
Reference in New Issue
Block a user