From 715daf1635cb98731245c5761d6055d0748e8409 Mon Sep 17 00:00:00 2001 From: Lance Chant <13349722+lancechant@users.noreply.github.com> Date: Tue, 27 Jan 2026 09:01:32 +0200 Subject: [PATCH] feat: skip intro Added skip intro logic Updated control button to take an icon or text Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> --- components/tv/TVControlButton.tsx | 16 ++++++++++++++-- components/video-player/controls/Controls.tv.tsx | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/components/tv/TVControlButton.tsx b/components/tv/TVControlButton.tsx index 49604ba5..c0b6a8fb 100644 --- a/components/tv/TVControlButton.tsx +++ b/components/tv/TVControlButton.tsx @@ -4,12 +4,14 @@ import { Pressable, Animated as RNAnimated, StyleSheet, + Text, type View, } from "react-native"; import { useTVFocusAnimation } from "./hooks/useTVFocusAnimation"; export interface TVControlButtonProps { - icon: keyof typeof Ionicons.glyphMap; + icon?: keyof typeof Ionicons.glyphMap; + text?: string; onPress: () => void; onLongPress?: () => void; onPressOut?: () => void; @@ -23,6 +25,7 @@ export interface TVControlButtonProps { export const TVControlButton: FC = ({ icon, + text, onPress, onLongPress, onPressOut, @@ -63,7 +66,11 @@ export const TVControlButton: FC = ({ }, ]} > - + {text ? ( + {text} + ) : ( + + )} ); @@ -78,4 +85,9 @@ const styles = StyleSheet.create({ justifyContent: "center", alignItems: "center", }, + text: { + color: "#fff", + fontWeight: "600", + textAlign: "center", + }, }); diff --git a/components/video-player/controls/Controls.tv.tsx b/components/video-player/controls/Controls.tv.tsx index dad6c082..89b12c46 100644 --- a/components/video-player/controls/Controls.tv.tsx +++ b/components/video-player/controls/Controls.tv.tsx @@ -33,6 +33,7 @@ import { TVControlButton, TVNextEpisodeCountdown } from "@/components/tv"; import { TVFocusableProgressBar } from "@/components/tv/TVFocusableProgressBar"; import { useScaledTVTypography } from "@/constants/TVTypography"; import useRouter from "@/hooks/useAppRouter"; +import { useIntroSkipper } from "@/hooks/useIntroSkipper"; import { usePlaybackManager } from "@/hooks/usePlaybackManager"; import { useTrickplay } from "@/hooks/useTrickplay"; import { useTVOptionModal } from "@/hooks/useTVOptionModal"; @@ -375,6 +376,15 @@ export const Controls: FC = ({ isSeeking, }); + const { showSkipButton, skipIntro } = useIntroSkipper( + item.Id!, + currentTime, + seek, + _play, + false, + api, + ); + const getFinishTime = () => { const now = new Date(); const finishTime = new Date(now.getTime() + remainingTime); @@ -1045,6 +1055,12 @@ export const Controls: FC = ({ disabled={false || !nextItem} size={28} /> +