Show playback failure overlay on tvOS

Previously a failed video left the user staring at a black screen / thumbnail
with no indication anything went wrong — playbackState went to .failed but
TVPlayerView never read it. Add a focusable glass overlay (Details / Retry /
Play Next or Close) gated on isFailed and a parallel one for retry-exhausted
state, with the regular controls and background tap-target disabled while
either is visible so focus stays inside the overlay. Hide the Copy/Share
toolbar items in ErrorDetailsSheet on tvOS where they aren't useful.
This commit is contained in:
Arkadiusz Fal
2026-05-07 18:29:48 +02:00
parent 158d518e3a
commit c8bb13e229
2 changed files with 211 additions and 5 deletions

View File

@@ -113,6 +113,7 @@ struct ErrorDetailsSheet: View {
.navigationBarTitleDisplayMode(.inline)
#endif
.toolbar {
#if !os(tvOS)
ToolbarItem(placement: .confirmationAction) {
Button(role: .cancel) {
dismiss()
@@ -131,14 +132,13 @@ struct ErrorDetailsSheet: View {
}
.accessibilityLabel(String(localized: "player.error.copy.accessibilityLabel"))
#if os(iOS) || os(macOS)
// Share button (not available on tvOS)
ShareLink(item: errorMessage) {
Label(String(localized: "player.error.share"), systemImage: "square.and.arrow.up")
}
.accessibilityLabel(String(localized: "player.error.share.accessibilityLabel"))
#endif
}
#endif
}
}
#if os(iOS)