From b6c3f0e71b28b9ea94ce962330d8940fc290597b Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 9 May 2026 11:00:04 +0200 Subject: [PATCH] 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. --- Yattee/Views/Player/tvOS/TVPlayerControlsView.swift | 6 +++++- Yattee/Views/Player/tvOS/TVPlayerView.swift | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Yattee/Views/Player/tvOS/TVPlayerControlsView.swift b/Yattee/Views/Player/tvOS/TVPlayerControlsView.swift index 5699a0f0..4631d2d6 100644 --- a/Yattee/Views/Player/tvOS/TVPlayerControlsView.swift +++ b/Yattee/Views/Player/tvOS/TVPlayerControlsView.swift @@ -21,6 +21,10 @@ struct TVPlayerControlsView: View { let onShowComments: () -> Void let onShowDebug: () -> 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 var onScrubbingChanged: ((Bool) -> Void)? /// Pending target time for the bar's accumulating remote-seek flow (arrow @@ -269,7 +273,7 @@ struct TVPlayerControlsView: View { Button { playPauseTapCount += 1 - playerService?.togglePlayPause() + onTogglePlayPause() } label: { Image(systemName: playPauseIcon) .font(.system(size: 32, weight: .semibold)) diff --git a/Yattee/Views/Player/tvOS/TVPlayerView.swift b/Yattee/Views/Player/tvOS/TVPlayerView.swift index 9a5bfe59..21a540cb 100644 --- a/Yattee/Views/Player/tvOS/TVPlayerView.swift +++ b/Yattee/Views/Player/tvOS/TVPlayerView.swift @@ -232,6 +232,7 @@ struct TVPlayerView: View { onShowComments: { showDetailsPanel(tab: .comments) }, onShowDebug: { showDebugOverlay() }, onClose: { closeVideo() }, + onTogglePlayPause: { handlePlayPause() }, onScrubbingChanged: { scrubbing in isScrubbing = scrubbing if scrubbing {