mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-21 16:56:29 +00:00
Compare commits
1 Commits
feat/tv-in
...
feat/tv-in
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
715daf1635 |
@@ -4,12 +4,14 @@ import {
|
|||||||
Pressable,
|
Pressable,
|
||||||
Animated as RNAnimated,
|
Animated as RNAnimated,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
|
Text,
|
||||||
type View,
|
type View,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { useTVFocusAnimation } from "./hooks/useTVFocusAnimation";
|
import { useTVFocusAnimation } from "./hooks/useTVFocusAnimation";
|
||||||
|
|
||||||
export interface TVControlButtonProps {
|
export interface TVControlButtonProps {
|
||||||
icon: keyof typeof Ionicons.glyphMap;
|
icon?: keyof typeof Ionicons.glyphMap;
|
||||||
|
text?: string;
|
||||||
onPress: () => void;
|
onPress: () => void;
|
||||||
onLongPress?: () => void;
|
onLongPress?: () => void;
|
||||||
onPressOut?: () => void;
|
onPressOut?: () => void;
|
||||||
@@ -23,6 +25,7 @@ export interface TVControlButtonProps {
|
|||||||
|
|
||||||
export const TVControlButton: FC<TVControlButtonProps> = ({
|
export const TVControlButton: FC<TVControlButtonProps> = ({
|
||||||
icon,
|
icon,
|
||||||
|
text,
|
||||||
onPress,
|
onPress,
|
||||||
onLongPress,
|
onLongPress,
|
||||||
onPressOut,
|
onPressOut,
|
||||||
@@ -63,7 +66,11 @@ export const TVControlButton: FC<TVControlButtonProps> = ({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Ionicons name={icon} size={size} color='#fff' />
|
{text ? (
|
||||||
|
<Text style={[styles.text, { fontSize: size * 0.4 }]}>{text}</Text>
|
||||||
|
) : (
|
||||||
|
<Ionicons name={icon!} size={size} color='#fff' />
|
||||||
|
)}
|
||||||
</RNAnimated.View>
|
</RNAnimated.View>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
);
|
);
|
||||||
@@ -78,4 +85,9 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
|
text: {
|
||||||
|
color: "#fff",
|
||||||
|
fontWeight: "600",
|
||||||
|
textAlign: "center",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import { TVControlButton, TVNextEpisodeCountdown } from "@/components/tv";
|
|||||||
import { TVFocusableProgressBar } from "@/components/tv/TVFocusableProgressBar";
|
import { TVFocusableProgressBar } from "@/components/tv/TVFocusableProgressBar";
|
||||||
import { useScaledTVTypography } from "@/constants/TVTypography";
|
import { useScaledTVTypography } from "@/constants/TVTypography";
|
||||||
import useRouter from "@/hooks/useAppRouter";
|
import useRouter from "@/hooks/useAppRouter";
|
||||||
|
import { useIntroSkipper } from "@/hooks/useIntroSkipper";
|
||||||
import { usePlaybackManager } from "@/hooks/usePlaybackManager";
|
import { usePlaybackManager } from "@/hooks/usePlaybackManager";
|
||||||
import { useTrickplay } from "@/hooks/useTrickplay";
|
import { useTrickplay } from "@/hooks/useTrickplay";
|
||||||
import { useTVOptionModal } from "@/hooks/useTVOptionModal";
|
import { useTVOptionModal } from "@/hooks/useTVOptionModal";
|
||||||
@@ -375,6 +376,15 @@ export const Controls: FC<Props> = ({
|
|||||||
isSeeking,
|
isSeeking,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { showSkipButton, skipIntro } = useIntroSkipper(
|
||||||
|
item.Id!,
|
||||||
|
currentTime,
|
||||||
|
seek,
|
||||||
|
_play,
|
||||||
|
false,
|
||||||
|
api,
|
||||||
|
);
|
||||||
|
|
||||||
const getFinishTime = () => {
|
const getFinishTime = () => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const finishTime = new Date(now.getTime() + remainingTime);
|
const finishTime = new Date(now.getTime() + remainingTime);
|
||||||
@@ -1045,6 +1055,12 @@ export const Controls: FC<Props> = ({
|
|||||||
disabled={false || !nextItem}
|
disabled={false || !nextItem}
|
||||||
size={28}
|
size={28}
|
||||||
/>
|
/>
|
||||||
|
<TVControlButton
|
||||||
|
text='skip intro'
|
||||||
|
onPress={skipIntro}
|
||||||
|
disabled={!showSkipButton}
|
||||||
|
size={28}
|
||||||
|
/>
|
||||||
|
|
||||||
<View style={styles.controlButtonsSpacer} />
|
<View style={styles.controlButtonsSpacer} />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user