mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-17 18:03:01 +01:00
feat(casting): chapter ticks on the cast progress bar
This commit is contained in:
@@ -545,6 +545,7 @@ export default function CastingPlayerScreen() {
|
|||||||
duration={duration}
|
duration={duration}
|
||||||
remoteMediaClient={remoteMediaClient}
|
remoteMediaClient={remoteMediaClient}
|
||||||
protocolColor={protocolColor}
|
protocolColor={protocolColor}
|
||||||
|
chapters={currentItem?.Chapters}
|
||||||
t={t}
|
t={t}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,14 @@
|
|||||||
* Progress slider with trickplay preview bubble and current/end time display.
|
* Progress slider with trickplay preview bubble and current/end time display.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import type { ChapterInfo } from "@jellyfin/sdk/lib/generated-client/models";
|
||||||
import type { TFunction } from "i18next";
|
import type { TFunction } from "i18next";
|
||||||
import { Text, View } from "react-native";
|
import { Text, View } from "react-native";
|
||||||
import { Slider } from "react-native-awesome-slider";
|
import { Slider } from "react-native-awesome-slider";
|
||||||
import type { RemoteMediaClient } from "react-native-google-cast";
|
import type { RemoteMediaClient } from "react-native-google-cast";
|
||||||
import type { SharedValue } from "react-native-reanimated";
|
import type { SharedValue } from "react-native-reanimated";
|
||||||
import { CastTrickplayBubble } from "@/components/casting/player/CastTrickplayBubble";
|
import { CastTrickplayBubble } from "@/components/casting/player/CastTrickplayBubble";
|
||||||
|
import { ChapterTicks } from "@/components/chapters/ChapterTicks";
|
||||||
import type { useTrickplay } from "@/hooks/useTrickplay";
|
import type { useTrickplay } from "@/hooks/useTrickplay";
|
||||||
import { DEBUG_TOUCH_ZONES } from "@/utils/casting/debug";
|
import { DEBUG_TOUCH_ZONES } from "@/utils/casting/debug";
|
||||||
import { calculateEndingTime, formatTime } from "@/utils/casting/helpers";
|
import { calculateEndingTime, formatTime } from "@/utils/casting/helpers";
|
||||||
@@ -47,6 +49,8 @@ interface CastPlayerProgressBarProps {
|
|||||||
remoteMediaClient: RemoteMediaClient | null;
|
remoteMediaClient: RemoteMediaClient | null;
|
||||||
/** Theme color used for the slider track and bubbles. */
|
/** Theme color used for the slider track and bubbles. */
|
||||||
protocolColor: string;
|
protocolColor: string;
|
||||||
|
/** Chapter markers for the current item, or null/undefined if none. */
|
||||||
|
chapters?: ChapterInfo[] | null;
|
||||||
/** Translation function. */
|
/** Translation function. */
|
||||||
t: TFunction;
|
t: TFunction;
|
||||||
}
|
}
|
||||||
@@ -65,6 +69,7 @@ export function CastPlayerProgressBar({
|
|||||||
duration,
|
duration,
|
||||||
remoteMediaClient,
|
remoteMediaClient,
|
||||||
protocolColor,
|
protocolColor,
|
||||||
|
chapters,
|
||||||
t,
|
t,
|
||||||
}: CastPlayerProgressBarProps) {
|
}: CastPlayerProgressBarProps) {
|
||||||
return (
|
return (
|
||||||
@@ -126,6 +131,7 @@ export function CastPlayerProgressBar({
|
|||||||
thumbWidth={16}
|
thumbWidth={16}
|
||||||
panHitSlop={{ top: 12, bottom: 12, left: 10, right: 10 }}
|
panHitSlop={{ top: 12, bottom: 12, left: 10, right: 10 }}
|
||||||
/>
|
/>
|
||||||
|
<ChapterTicks chapters={chapters} durationMs={duration * 1000} />
|
||||||
{__DEV__ && DEBUG_TOUCH_ZONES && (
|
{__DEV__ && DEBUG_TOUCH_ZONES && (
|
||||||
<View
|
<View
|
||||||
pointerEvents='none'
|
pointerEvents='none'
|
||||||
|
|||||||
Reference in New Issue
Block a user