mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-26 18:44:41 +01:00
feat(player): add chapter navigation support with visual markers
This commit is contained in:
@@ -18,6 +18,12 @@ interface CenterControlsProps {
|
||||
togglePlay: () => void;
|
||||
handleSkipBackward: () => void;
|
||||
handleSkipForward: () => void;
|
||||
// Chapter navigation props
|
||||
hasChapters?: boolean;
|
||||
hasPreviousChapter?: boolean;
|
||||
hasNextChapter?: boolean;
|
||||
goToPreviousChapter?: () => void;
|
||||
goToNextChapter?: () => void;
|
||||
}
|
||||
|
||||
export const CenterControls: FC<CenterControlsProps> = ({
|
||||
@@ -29,6 +35,11 @@ export const CenterControls: FC<CenterControlsProps> = ({
|
||||
togglePlay,
|
||||
handleSkipBackward,
|
||||
handleSkipForward,
|
||||
hasChapters = false,
|
||||
hasPreviousChapter = false,
|
||||
hasNextChapter = false,
|
||||
goToPreviousChapter,
|
||||
goToNextChapter,
|
||||
}) => {
|
||||
const { settings } = useSettings();
|
||||
const insets = useSafeAreaInsets();
|
||||
@@ -94,6 +105,20 @@ export const CenterControls: FC<CenterControlsProps> = ({
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
{!Platform.isTV && hasChapters && (
|
||||
<TouchableOpacity
|
||||
onPress={goToPreviousChapter}
|
||||
disabled={!hasPreviousChapter}
|
||||
style={{ opacity: hasPreviousChapter ? 1 : 0.3 }}
|
||||
>
|
||||
<Ionicons
|
||||
name='play-back'
|
||||
size={ICON_SIZES.CENTER - 10}
|
||||
color='white'
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
<View style={Platform.isTV ? { flex: 1, alignItems: "center" } : {}}>
|
||||
<TouchableOpacity onPress={togglePlay}>
|
||||
{!isBuffering ? (
|
||||
@@ -108,6 +133,20 @@ export const CenterControls: FC<CenterControlsProps> = ({
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
{!Platform.isTV && hasChapters && (
|
||||
<TouchableOpacity
|
||||
onPress={goToNextChapter}
|
||||
disabled={!hasNextChapter}
|
||||
style={{ opacity: hasNextChapter ? 1 : 0.3 }}
|
||||
>
|
||||
<Ionicons
|
||||
name='play-forward'
|
||||
size={ICON_SIZES.CENTER - 10}
|
||||
color='white'
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
{!Platform.isTV && (
|
||||
<TouchableOpacity onPress={handleSkipForward}>
|
||||
<View
|
||||
|
||||
Reference in New Issue
Block a user