Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Shared/Components/VideoPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
19 changes: 7 additions & 12 deletions Shared/Objects/VideoPlayerContainerState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -68,6 +58,11 @@ class VideoPlayerContainerState: ObservableObject {
@Published
var isGuestSupplement: Bool = false

func accessibilityToggleOverlay() {
isPresentingOverlay.toggle()
timer.stop()
}

// TODO: rename isPresentingPlaybackControls
@Published
var isPresentingOverlay: Bool = false {
Expand Down