From 70607bd98a666d07bf098806ddef8cacc35054c1 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 26 Sep 2025 22:42:58 +0000 Subject: [PATCH 1/2] Add vo-only button to toggle player overlay --- Shared/Components/VideoPlayer.swift | 11 +++++++++++ Shared/Objects/VideoPlayerContainerState.swift | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/Shared/Components/VideoPlayer.swift b/Shared/Components/VideoPlayer.swift index 717109a2d0..0fce1b8b05 100644 --- a/Shared/Components/VideoPlayer.swift +++ b/Shared/Components/VideoPlayer.swift @@ -66,6 +66,17 @@ struct VideoPlayer: View { .onSceneDidEnterBackground { manager.set(playbackRequestStatus: .paused) } + .overlay { + Rectangle() + .hidden() + .accessibilityRepresentation { + Button { + containerState.accessibilityToggleOverlay() + } label: { + Text("Toggle Overlay") + } + } + } } var body: some View { diff --git a/Shared/Objects/VideoPlayerContainerState.swift b/Shared/Objects/VideoPlayerContainerState.swift index 9aa4f20f54..133690cf5e 100644 --- a/Shared/Objects/VideoPlayerContainerState.swift +++ b/Shared/Objects/VideoPlayerContainerState.swift @@ -68,6 +68,11 @@ class VideoPlayerContainerState: ObservableObject { @Published var isGuestSupplement: Bool = false + func accessibilityToggleOverlay() { + isPresentingOverlay.toggle() + timer.stop() + } + // TODO: rename isPresentingPlaybackControls @Published var isPresentingOverlay: Bool = false { From c27bf1049c7995807ec89542bccbc1e4ee4e0bdb Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 26 Sep 2025 22:52:00 +0000 Subject: [PATCH 2/2] simplify overlay presentation logic --- Shared/Objects/VideoPlayerContainerState.swift | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Shared/Objects/VideoPlayerContainerState.swift b/Shared/Objects/VideoPlayerContainerState.swift index 133690cf5e..610c603f6a 100644 --- a/Shared/Objects/VideoPlayerContainerState.swift +++ b/Shared/Objects/VideoPlayerContainerState.swift @@ -40,22 +40,12 @@ class VideoPlayerContainerState: ObservableObject { return } - if isPresentingOverlay && !isPresentingSupplement { + guard isPresentingSupplement else { isPresentingPlaybackControls = true return } - if isCompact { - if isPresentingSupplement { - if !isPresentingPlaybackControls { - isPresentingPlaybackControls = true - } - } else { - isPresentingPlaybackControls = false - } - } else { - isPresentingPlaybackControls = false - } + isPresentingPlaybackControls = isCompact } @Published