Revert "Fade out tvOS player controls on auto-hide"

This reverts commit a65fbc44ff721a7cb73afd04c41bd44d58bcb034.
This commit is contained in:
Arkadiusz Fal
2026-04-15 19:39:06 +02:00
parent eb697b7bbc
commit 944f849929

View File

@@ -201,9 +201,8 @@ struct TVPlayerView: View {
// Video layer
videoLayer
// Controls overlay always in tree, toggled via opacity so the fade-out
// isn't skipped by tvOS's focus engine forcibly tearing down a focused
// subview when the conditional flips to false.
// Controls overlay
if controlsVisible && !isDetailsPanelVisible && !isDebugOverlayVisible {
TVPlayerControlsView(
playerState: playerState,
playerService: playerService,
@@ -228,10 +227,8 @@ struct TVPlayerView: View {
},
cancelScrubTrigger: cancelScrubTrigger
)
.opacity(shouldShowControls ? 1 : 0)
.allowsHitTesting(shouldShowControls)
.disabled(!shouldShowControls)
.animation(.easeInOut(duration: 0.25), value: shouldShowControls)
.transition(.opacity.animation(.easeInOut(duration: 0.25)))
}
// Swipe-up details panel
if isDetailsPanelVisible {
@@ -385,13 +382,6 @@ struct TVPlayerView: View {
}
}
// MARK: - Derived State
/// Whether the primary controls overlay should be visible right now.
private var shouldShowControls: Bool {
controlsVisible && !isDetailsPanelVisible && !isDebugOverlayVisible
}
// MARK: - Controls Timer
private func startControlsTimer() {
@@ -402,8 +392,9 @@ struct TVPlayerView: View {
controlsHideTimer = Timer.scheduledTimer(withTimeInterval: 4.0, repeats: false) { _ in
Task { @MainActor in
withAnimation(.easeOut(duration: 0.2)) {
withAnimation(.easeOut(duration: 0.3)) {
controlsVisible = false
focusedControl = .background
}
}
}
@@ -671,8 +662,9 @@ struct TVPlayerView: View {
private func hideControls() {
stopControlsTimer()
withAnimation(.easeOut(duration: 0.2)) {
withAnimation(.easeOut(duration: 0.25)) {
controlsVisible = false
focusedControl = .background
}
}