From bf3a37c61c82197e9b575a6427ba6e8cb7ee1902 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Thu, 29 Jan 2026 18:05:53 +0100 Subject: [PATCH] feat(player): change technical info button icon to code-slash --- .../video-player/controls/Controls.tv.tsx | 73 +++++++++++++------ 1 file changed, 52 insertions(+), 21 deletions(-) diff --git a/components/video-player/controls/Controls.tv.tsx b/components/video-player/controls/Controls.tv.tsx index 18369ab4..bf4d2eed 100644 --- a/components/video-player/controls/Controls.tv.tsx +++ b/components/video-player/controls/Controls.tv.tsx @@ -375,6 +375,15 @@ export const Controls: FC = ({ isSeeking, }); + // Countdown logic - needs to be early so toggleControls can reference it + const shouldShowCountdown = useMemo(() => { + if (!nextItem) return false; + if (item?.Type !== "Episode") return false; + return remainingTime > 0 && remainingTime <= 10000; + }, [nextItem, item, remainingTime]); + + const isCountdownActive = shouldShowCountdown; + // Live TV detection - check for both Program (when playing from guide) and TvChannel (when playing from channels) const isLiveTV = item?.Type === "Program" || item?.Type === "TvChannel"; @@ -760,7 +769,11 @@ export const Controls: FC = ({ calculateTrickplayUrl(msToTicks(newPosition)); updateSeekBubbleTime(newPosition); - seekAccelerationRef.current *= CONTROLS_CONSTANTS.LONG_PRESS_ACCELERATION; + seekAccelerationRef.current = Math.min( + seekAccelerationRef.current * + CONTROLS_CONSTANTS.LONG_PRESS_ACCELERATION, + CONTROLS_CONSTANTS.LONG_PRESS_MAX_ACCELERATION, + ); controlsInteractionRef.current(); }, CONTROLS_CONSTANTS.LONG_PRESS_INTERVAL); @@ -792,7 +805,11 @@ export const Controls: FC = ({ calculateTrickplayUrl(msToTicks(newPosition)); updateSeekBubbleTime(newPosition); - seekAccelerationRef.current *= CONTROLS_CONSTANTS.LONG_PRESS_ACCELERATION; + seekAccelerationRef.current = Math.min( + seekAccelerationRef.current * + CONTROLS_CONSTANTS.LONG_PRESS_ACCELERATION, + CONTROLS_CONSTANTS.LONG_PRESS_MAX_ACCELERATION, + ); controlsInteractionRef.current(); }, CONTROLS_CONSTANTS.LONG_PRESS_INTERVAL); @@ -826,10 +843,12 @@ export const Controls: FC = ({ }, []); // Callback for up/down D-pad - show controls with play button focused + // Skip if countdown is active (card has focus, don't show controls) const handleVerticalDpad = useCallback(() => { + if (isCountdownActive) return; setFocusPlayButton(true); setShowControls(true); - }, [setShowControls]); + }, [setShowControls, isCountdownActive]); const { isSliding: isRemoteSliding } = useRemoteControl({ showControls, @@ -934,12 +953,6 @@ export const Controls: FC = ({ goToNextItemRef.current = goToNextItem; - const shouldShowCountdown = useMemo(() => { - if (!nextItem) return false; - if (item?.Type !== "Episode") return false; - return remainingTime > 0 && remainingTime <= 10000; - }, [nextItem, item, remainingTime]); - const handleAutoPlayFinish = useCallback(() => { goToNextItem({ isAutoPlay: true }); }, [goToNextItem]); @@ -971,6 +984,9 @@ export const Controls: FC = ({ show={shouldShowCountdown} isPlaying={isPlaying} onFinish={handleAutoPlayFinish} + onPlayNext={handleNextItemButton} + hasFocus={isCountdownActive} + controlsVisible={showControls} /> )} @@ -1101,21 +1117,25 @@ export const Controls: FC = ({ @@ -1125,8 +1145,10 @@ export const Controls: FC = ({ )} @@ -1134,17 +1156,21 @@ export const Controls: FC = ({ {getTechnicalInfo && ( )} @@ -1187,7 +1213,12 @@ export const Controls: FC = ({ onFocus={() => setIsProgressBarFocused(true)} onBlur={() => setIsProgressBarFocused(false)} refSetter={setProgressBarRef} - hasTVPreferredFocus={lastOpenedModal === null && !focusPlayButton} + disabled={isCountdownActive} + hasTVPreferredFocus={ + !isCountdownActive && + lastOpenedModal === null && + !focusPlayButton + } />