mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
Compare commits
1 Commits
refactor-p
...
renovate/r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1306a349c3 |
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable react-native/no-inline-styles */
|
||||
import {
|
||||
type BaseItemDto,
|
||||
type MediaSourceInfo,
|
||||
@@ -14,14 +13,7 @@ import {
|
||||
import { activateKeepAwakeAsync, deactivateKeepAwake } from "expo-keep-awake";
|
||||
import { router, useGlobalSearchParams, useNavigation } from "expo-router";
|
||||
import { useAtomValue } from "jotai";
|
||||
import {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useReducer,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Alert, Platform, View } from "react-native";
|
||||
import { useSharedValue } from "react-native-reanimated";
|
||||
@@ -55,74 +47,49 @@ const downloadProvider = !Platform.isTV
|
||||
|
||||
const IGNORE_SAFE_AREAS_KEY = "video_player_ignore_safe_areas";
|
||||
|
||||
/* Playback state reducer to consolidate related state */
|
||||
interface VideoState {
|
||||
isPlaying: boolean;
|
||||
isMuted: boolean;
|
||||
isBuffering: boolean;
|
||||
isVideoLoaded: boolean;
|
||||
isPipStarted: boolean;
|
||||
}
|
||||
type VideoAction =
|
||||
| { type: "PLAYING_CHANGED"; value: boolean }
|
||||
| { type: "BUFFERING_CHANGED"; value: boolean }
|
||||
| { type: "VIDEO_LOADED" }
|
||||
| { type: "MUTED_CHANGED"; value: boolean }
|
||||
| { type: "PIP_CHANGED"; value: boolean };
|
||||
|
||||
const videoReducer = (state: VideoState, action: VideoAction): VideoState => {
|
||||
switch (action.type) {
|
||||
case "PLAYING_CHANGED":
|
||||
return { ...state, isPlaying: action.value };
|
||||
case "BUFFERING_CHANGED":
|
||||
return { ...state, isBuffering: action.value };
|
||||
case "VIDEO_LOADED":
|
||||
// Mark video as loaded and buffering false here
|
||||
return { ...state, isVideoLoaded: true, isBuffering: false };
|
||||
case "MUTED_CHANGED":
|
||||
return { ...state, isMuted: action.value };
|
||||
case "PIP_CHANGED":
|
||||
return { ...state, isPipStarted: action.value };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
const initialVideoState: VideoState = {
|
||||
isPlaying: false,
|
||||
isMuted: false,
|
||||
isBuffering: true,
|
||||
isVideoLoaded: false,
|
||||
isPipStarted: false,
|
||||
};
|
||||
|
||||
export default function DirectPlayerPage() {
|
||||
export default function page() {
|
||||
const videoRef = useRef<VlcPlayerViewRef>(null);
|
||||
const user = useAtomValue(userAtom);
|
||||
const api = useAtomValue(apiAtom);
|
||||
const navigation = useNavigation();
|
||||
const { t } = useTranslation();
|
||||
const navigation = useNavigation();
|
||||
|
||||
/* Consolidated video playback state */
|
||||
const [videoState, dispatch] = useReducer(videoReducer, initialVideoState);
|
||||
|
||||
const [isPlaybackStopped, setIsPlaybackStopped] = useState(false);
|
||||
const [showControls, _setShowControls] = useState(true);
|
||||
const [ignoreSafeAreas, setIgnoreSafeAreas] = useState(() => {
|
||||
return storage.getBoolean(IGNORE_SAFE_AREAS_KEY) ?? false;
|
||||
// Load persisted state from storage
|
||||
const saved = storage.getBoolean(IGNORE_SAFE_AREAS_KEY);
|
||||
return saved ?? false;
|
||||
});
|
||||
const [isPlaybackStopped, setIsPlaybackStopped] = useState(false);
|
||||
|
||||
const insets = useSafeAreaInsets();
|
||||
const [settings] = useSettings();
|
||||
const [isPlaying, setIsPlaying] = useState(false);
|
||||
const [isMuted, setIsMuted] = useState(false);
|
||||
const [isBuffering, setIsBuffering] = useState(true);
|
||||
const [isVideoLoaded, setIsVideoLoaded] = useState(false);
|
||||
const [isPipStarted, setIsPipStarted] = useState(false);
|
||||
|
||||
const progress = useSharedValue(0);
|
||||
const isSeeking = useSharedValue(false);
|
||||
const cacheProgress = useSharedValue(0);
|
||||
const lightHapticFeedback = useHaptic("light");
|
||||
const VolumeManager = Platform.isTV
|
||||
? null
|
||||
: require("react-native-volume-manager");
|
||||
|
||||
const getDownloadedItem = downloadProvider.useDownload();
|
||||
|
||||
const revalidateProgressCache = useInvalidatePlaybackProgressCache();
|
||||
|
||||
const lightHapticFeedback = useHaptic("light");
|
||||
|
||||
const setShowControls = useCallback((show: boolean) => {
|
||||
_setShowControls(show);
|
||||
lightHapticFeedback();
|
||||
}, []);
|
||||
|
||||
// Persist ignoreSafeAreas state whenever it changes
|
||||
useEffect(() => {
|
||||
storage.set(IGNORE_SAFE_AREAS_KEY, ignoreSafeAreas);
|
||||
}, [ignoreSafeAreas]);
|
||||
|
||||
const {
|
||||
itemId,
|
||||
audioIndex: audioIndexStr,
|
||||
@@ -138,82 +105,71 @@ export default function DirectPlayerPage() {
|
||||
mediaSourceId: string;
|
||||
bitrateValue: string;
|
||||
offline: string;
|
||||
/** Playback position in ticks. */
|
||||
playbackPosition?: string;
|
||||
}>();
|
||||
|
||||
const [settings] = useSettings();
|
||||
const insets = useSafeAreaInsets();
|
||||
const offline = offlineStr === "true";
|
||||
const audioIndex = audioIndexStr ? parseInt(audioIndexStr, 10) : undefined;
|
||||
const subtitleIndex = subtitleIndexStr ? parseInt(subtitleIndexStr, 10) : -1;
|
||||
|
||||
const audioIndex = audioIndexStr
|
||||
? Number.parseInt(audioIndexStr, 10)
|
||||
: undefined;
|
||||
const subtitleIndex = subtitleIndexStr
|
||||
? Number.parseInt(subtitleIndexStr, 10)
|
||||
: -1;
|
||||
const bitrateValue = bitrateValueStr
|
||||
? parseInt(bitrateValueStr, 10)
|
||||
? Number.parseInt(bitrateValueStr, 10)
|
||||
: BITRATES[0].value;
|
||||
|
||||
const setShowControls = useCallback(
|
||||
(show: boolean) => {
|
||||
_setShowControls(show);
|
||||
lightHapticFeedback();
|
||||
},
|
||||
[lightHapticFeedback],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
storage.set(IGNORE_SAFE_AREAS_KEY, ignoreSafeAreas);
|
||||
}, [ignoreSafeAreas]);
|
||||
|
||||
/* Fetch the item info */
|
||||
const [item, setItem] = useState<BaseItemDto | null>(null);
|
||||
const [itemStatus, setItemStatus] = useState({
|
||||
isLoading: true,
|
||||
isError: false,
|
||||
});
|
||||
const getDownloadedItem = downloadProvider.useDownload();
|
||||
|
||||
/** Gets the initial playback position from the URL or the item's user data. */
|
||||
const getInitialPlaybackTicks = useCallback((): number => {
|
||||
if (playbackPositionFromUrl) {
|
||||
return parseInt(playbackPositionFromUrl, 10);
|
||||
return Number.parseInt(playbackPositionFromUrl, 10);
|
||||
}
|
||||
return item?.UserData?.PlaybackPositionTicks ?? 0;
|
||||
}, [playbackPositionFromUrl, item]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!itemId) return;
|
||||
|
||||
const controller = new AbortController();
|
||||
(async () => {
|
||||
const fetchItemData = async () => {
|
||||
setItemStatus({ isLoading: true, isError: false });
|
||||
try {
|
||||
let fetchedItem: BaseItemDto | null = null;
|
||||
if (offline && !Platform.isTV) {
|
||||
const data = await getDownloadedItem.getDownloadedItem(itemId);
|
||||
fetchedItem = data?.item as BaseItemDto | null;
|
||||
if (data) fetchedItem = data.item as BaseItemDto;
|
||||
} else {
|
||||
const res = await getUserLibraryApi(api!).getItem(
|
||||
{ itemId, userId: user?.Id },
|
||||
{ signal: controller.signal },
|
||||
);
|
||||
const res = await getUserLibraryApi(api!).getItem({
|
||||
itemId,
|
||||
userId: user?.Id,
|
||||
});
|
||||
fetchedItem = res.data;
|
||||
}
|
||||
if (!controller.signal.aborted) {
|
||||
setItem(fetchedItem);
|
||||
setItemStatus({ isLoading: false, isError: false });
|
||||
}
|
||||
setItem(fetchedItem);
|
||||
setItemStatus({ isLoading: false, isError: false });
|
||||
} catch (error) {
|
||||
if (!controller.signal.aborted) {
|
||||
console.error("Failed to fetch item:", error);
|
||||
setItemStatus({ isLoading: false, isError: true });
|
||||
}
|
||||
console.error("Failed to fetch item:", error);
|
||||
setItemStatus({ isLoading: false, isError: true });
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
return () => controller.abort();
|
||||
}, [itemId, offline, api, user?.Id, getDownloadedItem]);
|
||||
if (itemId) {
|
||||
fetchItemData();
|
||||
}
|
||||
}, [itemId, offline, api, user?.Id]);
|
||||
|
||||
/* Fetch stream info */
|
||||
interface Stream {
|
||||
mediaSource: MediaSourceInfo;
|
||||
sessionId: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
const [stream, setStream] = useState<Stream | null>(null);
|
||||
const [streamStatus, setStreamStatus] = useState({
|
||||
isLoading: true,
|
||||
@@ -223,16 +179,18 @@ export default function DirectPlayerPage() {
|
||||
useEffect(() => {
|
||||
const fetchStreamData = async () => {
|
||||
setStreamStatus({ isLoading: true, isError: false });
|
||||
const native = await generateDeviceProfile();
|
||||
try {
|
||||
const native = await generateDeviceProfile();
|
||||
let result: Stream | null = null;
|
||||
|
||||
if (offline && !Platform.isTV) {
|
||||
const data = await getDownloadedItem.getDownloadedItem(itemId);
|
||||
if (!data?.mediaSource) return;
|
||||
const url = await getDownloadedFileUrl(data.item.Id!);
|
||||
result = { mediaSource: data.mediaSource, sessionId: "", url };
|
||||
} else if (item) {
|
||||
if (item) {
|
||||
result = { mediaSource: data.mediaSource, sessionId: "", url };
|
||||
}
|
||||
} else {
|
||||
if (!item) return;
|
||||
const res = await getStreamUrl({
|
||||
api,
|
||||
item,
|
||||
@@ -240,7 +198,7 @@ export default function DirectPlayerPage() {
|
||||
userId: user?.Id,
|
||||
audioStreamIndex: audioIndex,
|
||||
maxStreamingBitrate: bitrateValue,
|
||||
mediaSourceId,
|
||||
mediaSourceId: mediaSourceId,
|
||||
subtitleStreamIndex: subtitleIndex,
|
||||
deviceProfile: native,
|
||||
});
|
||||
@@ -255,7 +213,6 @@ export default function DirectPlayerPage() {
|
||||
}
|
||||
result = { mediaSource, sessionId, url };
|
||||
}
|
||||
|
||||
setStream(result);
|
||||
setStreamStatus({ isLoading: false, isError: false });
|
||||
} catch (error) {
|
||||
@@ -263,310 +220,219 @@ export default function DirectPlayerPage() {
|
||||
setStreamStatus({ isLoading: false, isError: true });
|
||||
}
|
||||
};
|
||||
|
||||
fetchStreamData();
|
||||
}, [
|
||||
itemId,
|
||||
mediaSourceId,
|
||||
bitrateValue,
|
||||
api,
|
||||
item,
|
||||
user?.Id,
|
||||
offline,
|
||||
getInitialPlaybackTicks,
|
||||
audioIndex,
|
||||
subtitleIndex,
|
||||
]);
|
||||
}, [itemId, mediaSourceId, bitrateValue, api, item, user?.Id]);
|
||||
|
||||
const revalidateProgressCache = useInvalidatePlaybackProgressCache();
|
||||
useEffect(() => {
|
||||
if (!stream) return;
|
||||
|
||||
/* Memoized playback state info for reporting */
|
||||
const currentPlayStateInfo = useMemo(() => {
|
||||
if (!stream) return null;
|
||||
return {
|
||||
itemId: item?.Id!,
|
||||
audioStreamIndex: audioIndex,
|
||||
subtitleStreamIndex: subtitleIndex,
|
||||
mediaSourceId,
|
||||
positionTicks: msToTicks(progress.get()),
|
||||
isPaused: !videoState.isPlaying,
|
||||
playMethod: stream.url.includes("m3u8") ? "Transcode" : "DirectStream",
|
||||
playSessionId: stream.sessionId,
|
||||
isMuted: videoState.isMuted,
|
||||
canSeek: true,
|
||||
repeatMode: RepeatMode.RepeatNone,
|
||||
playbackOrder: PlaybackOrder.Default,
|
||||
const reportPlaybackStart = async () => {
|
||||
await getPlaystateApi(api!).reportPlaybackStart({
|
||||
playbackStartInfo: currentPlayStateInfo() as PlaybackStartInfo,
|
||||
});
|
||||
};
|
||||
}, [
|
||||
item?.Id,
|
||||
audioIndex,
|
||||
subtitleIndex,
|
||||
mediaSourceId,
|
||||
progress,
|
||||
videoState.isPlaying,
|
||||
videoState.isMuted,
|
||||
stream,
|
||||
]);
|
||||
|
||||
/* Playback progress reporting */
|
||||
const reportPlaybackProgress = useCallback(async () => {
|
||||
if (!api || offline || !stream || !currentPlayStateInfo) return;
|
||||
await getPlaystateApi(api).reportPlaybackProgress({
|
||||
playbackProgressInfo: currentPlayStateInfo as PlaybackProgressInfo,
|
||||
});
|
||||
}, [api, offline, stream, currentPlayStateInfo]);
|
||||
reportPlaybackStart();
|
||||
}, [stream]);
|
||||
|
||||
const togglePlay = async () => {
|
||||
lightHapticFeedback();
|
||||
setIsPlaying(!isPlaying);
|
||||
if (isPlaying) {
|
||||
await videoRef.current?.pause();
|
||||
reportPlaybackProgress();
|
||||
} else {
|
||||
videoRef.current?.play();
|
||||
await getPlaystateApi(api!).reportPlaybackStart({
|
||||
playbackStartInfo: currentPlayStateInfo() as PlaybackStartInfo,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/* Report playback stopped */
|
||||
const reportPlaybackStopped = useCallback(async () => {
|
||||
if (offline || !stream) return;
|
||||
if (offline) return;
|
||||
const currentTimeInTicks = msToTicks(progress.get());
|
||||
await getPlaystateApi(api!).onPlaybackStopped({
|
||||
itemId: item?.Id!,
|
||||
mediaSourceId,
|
||||
positionTicks: msToTicks(progress.get()),
|
||||
playSessionId: stream.sessionId,
|
||||
mediaSourceId: mediaSourceId,
|
||||
positionTicks: currentTimeInTicks,
|
||||
playSessionId: stream?.sessionId!,
|
||||
});
|
||||
|
||||
revalidateProgressCache();
|
||||
}, [
|
||||
api,
|
||||
item?.Id,
|
||||
item,
|
||||
mediaSourceId,
|
||||
progress,
|
||||
stream,
|
||||
progress,
|
||||
offline,
|
||||
revalidateProgressCache,
|
||||
]);
|
||||
|
||||
/* Toggle play/pause */
|
||||
const togglePlay = useCallback(async () => {
|
||||
lightHapticFeedback();
|
||||
const playing = videoState.isPlaying;
|
||||
dispatch({ type: "PLAYING_CHANGED", value: !playing });
|
||||
|
||||
if (playing) {
|
||||
await videoRef.current?.pause();
|
||||
reportPlaybackProgress();
|
||||
} else {
|
||||
await videoRef.current?.play();
|
||||
if (currentPlayStateInfo) {
|
||||
await getPlaystateApi(api!).reportPlaybackStart({
|
||||
playbackStartInfo: currentPlayStateInfo as PlaybackStartInfo,
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [
|
||||
videoState.isPlaying,
|
||||
lightHapticFeedback,
|
||||
reportPlaybackProgress,
|
||||
api,
|
||||
currentPlayStateInfo,
|
||||
]);
|
||||
|
||||
/* Stop playback and clean up */
|
||||
const stop = useCallback(() => {
|
||||
reportPlaybackStopped();
|
||||
setIsPlaybackStopped(true);
|
||||
videoRef.current?.stop();
|
||||
}, [reportPlaybackStopped]);
|
||||
}, [videoRef, reportPlaybackStopped]);
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = navigation.addListener("beforeRemove", stop);
|
||||
return unsubscribe;
|
||||
const beforeRemoveListener = navigation.addListener("beforeRemove", stop);
|
||||
return () => {
|
||||
beforeRemoveListener();
|
||||
};
|
||||
}, [navigation, stop]);
|
||||
|
||||
/* VLC init options optimized for performance */
|
||||
const optimizedInitOptions = useMemo(() => {
|
||||
const opts = [`--sub-text-scale=${settings.subtitleSize}`];
|
||||
// Reduce buffering memory usage
|
||||
opts.push("--network-caching=300", "--file-caching=300");
|
||||
if (Platform.OS === "android") opts.push("--aout=opensles");
|
||||
if (Platform.OS === "ios") opts.push("--ios-hw-decoding");
|
||||
const currentPlayStateInfo = () => {
|
||||
if (!stream) return;
|
||||
return {
|
||||
itemId: item?.Id!,
|
||||
audioStreamIndex: audioIndex ? audioIndex : undefined,
|
||||
subtitleStreamIndex: subtitleIndex ? subtitleIndex : undefined,
|
||||
mediaSourceId: mediaSourceId,
|
||||
positionTicks: msToTicks(progress.get()),
|
||||
isPaused: !isPlaying,
|
||||
playMethod: stream?.url.includes("m3u8") ? "Transcode" : "DirectStream",
|
||||
playSessionId: stream.sessionId,
|
||||
isMuted: isMuted,
|
||||
canSeek: true,
|
||||
repeatMode: RepeatMode.RepeatNone,
|
||||
playbackOrder: PlaybackOrder.Default,
|
||||
};
|
||||
};
|
||||
|
||||
// Pre-selection of audio & subtitle tracks handled here
|
||||
const notTranscoding = !stream?.mediaSource.TranscodingUrl;
|
||||
const allAudio =
|
||||
stream?.mediaSource.MediaStreams?.filter((s) => s.Type === "Audio") ?? [];
|
||||
const allSubs =
|
||||
stream?.mediaSource.MediaStreams?.filter(
|
||||
(s) => s.Type === "Subtitle",
|
||||
)?.sort((a, b) => Number(a.IsExternal) - Number(b.IsExternal)) ?? [];
|
||||
|
||||
if (subtitleIndex >= 0) {
|
||||
const chosenSubtitleTrack = allSubs.find(
|
||||
(s) => s.Index === subtitleIndex,
|
||||
);
|
||||
const textSubs = allSubs.filter((s) => s.IsTextSubtitleStream);
|
||||
if (
|
||||
chosenSubtitleTrack &&
|
||||
(notTranscoding || chosenSubtitleTrack.IsTextSubtitleStream)
|
||||
) {
|
||||
const finalIdx = notTranscoding
|
||||
? allSubs.indexOf(chosenSubtitleTrack)
|
||||
: textSubs.indexOf(chosenSubtitleTrack);
|
||||
opts.push(`--sub-track=${finalIdx}`);
|
||||
}
|
||||
}
|
||||
if (notTranscoding && audioIndex !== undefined) {
|
||||
const chosenAudioTrack = allAudio.find((a) => a.Index === audioIndex);
|
||||
if (chosenAudioTrack)
|
||||
opts.push(`--audio-track=${allAudio.indexOf(chosenAudioTrack)}`);
|
||||
}
|
||||
|
||||
return opts;
|
||||
}, [settings.subtitleSize, stream?.mediaSource, subtitleIndex, audioIndex]);
|
||||
|
||||
/* On Picture-In-Picture started or stopped */
|
||||
const onPipStarted = useCallback((e: PipStartedPayload) => {
|
||||
dispatch({ type: "PIP_CHANGED", value: e.nativeEvent.pipStarted });
|
||||
}, []);
|
||||
|
||||
/* Progress event handler */
|
||||
const onProgress = useCallback(
|
||||
(data: ProgressUpdatePayload) => {
|
||||
async (data: ProgressUpdatePayload) => {
|
||||
if (isSeeking.get() || isPlaybackStopped) return;
|
||||
if (videoState.isBuffering)
|
||||
dispatch({ type: "BUFFERING_CHANGED", value: false });
|
||||
|
||||
const { currentTime } = data.nativeEvent;
|
||||
if (isBuffering) {
|
||||
setIsBuffering(false);
|
||||
}
|
||||
|
||||
progress.set(currentTime);
|
||||
router.setParams({ playbackPosition: msToTicks(currentTime).toString() });
|
||||
if (!offline) reportPlaybackProgress();
|
||||
|
||||
// Update the playback position in the URL.
|
||||
router.setParams({
|
||||
playbackPosition: msToTicks(currentTime).toString(),
|
||||
});
|
||||
|
||||
if (offline) return;
|
||||
if (!item?.Id || !stream) return;
|
||||
|
||||
reportPlaybackProgress();
|
||||
},
|
||||
[
|
||||
item?.Id,
|
||||
audioIndex,
|
||||
subtitleIndex,
|
||||
mediaSourceId,
|
||||
isPlaying,
|
||||
stream,
|
||||
isSeeking,
|
||||
isPlaybackStopped,
|
||||
progress,
|
||||
offline,
|
||||
reportPlaybackProgress,
|
||||
videoState.isBuffering,
|
||||
isBuffering,
|
||||
],
|
||||
);
|
||||
|
||||
/* Playback state changes */
|
||||
const onPlaybackStateChanged = useCallback(
|
||||
async (e: PlaybackStatePayload) => {
|
||||
const { state, isBuffering, isPlaying } = e.nativeEvent;
|
||||
switch (state) {
|
||||
case "Playing":
|
||||
dispatch({ type: "PLAYING_CHANGED", value: true });
|
||||
await activateKeepAwakeAsync();
|
||||
reportPlaybackProgress();
|
||||
break;
|
||||
case "Paused":
|
||||
dispatch({ type: "PLAYING_CHANGED", value: false });
|
||||
await deactivateKeepAwake();
|
||||
reportPlaybackProgress();
|
||||
break;
|
||||
default:
|
||||
dispatch({ type: "BUFFERING_CHANGED", value: !!isBuffering });
|
||||
dispatch({ type: "PLAYING_CHANGED", value: !!isPlaying });
|
||||
}
|
||||
},
|
||||
[reportPlaybackProgress],
|
||||
);
|
||||
const onPipStarted = useCallback((e: PipStartedPayload) => {
|
||||
const { pipStarted } = e.nativeEvent;
|
||||
setIsPipStarted(pipStarted);
|
||||
}, []);
|
||||
|
||||
/* Safe wrapper for player methods that skips calls if video not loaded */
|
||||
const safeMethod =
|
||||
<T extends unknown[]>(
|
||||
fn: ((...args: T) => any) | undefined,
|
||||
name: string,
|
||||
) =>
|
||||
async (...args: T) => {
|
||||
// New safeguard: skip calling if video not loaded yet
|
||||
if (!videoState.isVideoLoaded) {
|
||||
writeToLog("WARN", `${name} skipped - video not loaded yet`);
|
||||
return;
|
||||
}
|
||||
if (!fn) {
|
||||
writeToLog("ERROR", `${name} fn missing`, {
|
||||
isVideoLoaded: videoState.isVideoLoaded,
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
return await fn(...args);
|
||||
} catch (error) {
|
||||
writeToLog("ERROR", `Error in ${name}`, {
|
||||
error,
|
||||
isVideoLoaded: videoState.isVideoLoaded,
|
||||
});
|
||||
}
|
||||
};
|
||||
const reportPlaybackProgress = useCallback(async () => {
|
||||
if (!api || offline || !stream) return;
|
||||
await getPlaystateApi(api).reportPlaybackProgress({
|
||||
playbackProgressInfo: currentPlayStateInfo() as PlaybackProgressInfo,
|
||||
});
|
||||
}, [
|
||||
api,
|
||||
isPlaying,
|
||||
offline,
|
||||
stream,
|
||||
item?.Id,
|
||||
audioIndex,
|
||||
subtitleIndex,
|
||||
mediaSourceId,
|
||||
progress,
|
||||
]);
|
||||
|
||||
const play = useCallback(
|
||||
() => safeMethod(videoRef.current?.play, "play")(),
|
||||
[videoRef],
|
||||
);
|
||||
const pause = useCallback(
|
||||
() => safeMethod(videoRef.current?.pause, "pause")(),
|
||||
[videoRef],
|
||||
);
|
||||
const startPictureInPicture = useCallback(
|
||||
() => safeMethod(videoRef.current?.startPictureInPicture, "PiP")(),
|
||||
[videoRef],
|
||||
);
|
||||
const seek = useCallback(
|
||||
(t: number) => safeMethod(videoRef.current?.seekTo, "seek")(t),
|
||||
[videoRef],
|
||||
);
|
||||
const getAudioTracks = useCallback(
|
||||
() => safeMethod(videoRef.current?.getAudioTracks, "getAudioTracks")(),
|
||||
[videoRef],
|
||||
);
|
||||
const getSubtitleTracks = useCallback(
|
||||
() =>
|
||||
safeMethod(videoRef.current?.getSubtitleTracks, "getSubtitleTracks")(),
|
||||
[videoRef],
|
||||
);
|
||||
const setAudioTrack = useCallback(
|
||||
(i: number) =>
|
||||
safeMethod(videoRef.current?.setAudioTrack, "setAudioTrack")(i),
|
||||
[videoRef],
|
||||
);
|
||||
const setSubtitleTrack = useCallback(
|
||||
(i: number) =>
|
||||
safeMethod(videoRef.current?.setSubtitleTrack, "setSubtitleTrack")(i),
|
||||
[videoRef],
|
||||
);
|
||||
const setSubtitleURL = useCallback(
|
||||
(url: string, n: string) =>
|
||||
safeMethod(videoRef.current?.setSubtitleURL, "setSubtitleURL")(url, n),
|
||||
[videoRef],
|
||||
);
|
||||
/** Gets the initial playback position in seconds. */
|
||||
const startPosition = useMemo(() => {
|
||||
if (offline) return 0;
|
||||
return ticksToSeconds(getInitialPlaybackTicks());
|
||||
}, [offline, getInitialPlaybackTicks]);
|
||||
|
||||
/* Volume handlers */
|
||||
const [previousVolume, setPreviousVolume] = useState<number | null>(null);
|
||||
const volumeUpCb = useCallback(async () => {
|
||||
if (Platform.isTV) return;
|
||||
const { volume } = await VolumeManager.getVolume();
|
||||
await VolumeManager.setVolume(Math.min(volume + 0.1, 1));
|
||||
}, []);
|
||||
const volumeDownCb = useCallback(async () => {
|
||||
if (Platform.isTV) return;
|
||||
const { volume } = await VolumeManager.getVolume();
|
||||
await VolumeManager.setVolume(Math.max(volume - 0.1, 0));
|
||||
}, []);
|
||||
const setVolumeCb = useCallback(async (v: number) => {
|
||||
if (Platform.isTV) return;
|
||||
await VolumeManager.setVolume(Math.max(0, Math.min(v, 100)) / 100);
|
||||
|
||||
try {
|
||||
const { volume: currentVolume } = await VolumeManager.getVolume();
|
||||
const newVolume = Math.min(currentVolume + 0.1, 1.0);
|
||||
|
||||
await VolumeManager.setVolume(newVolume);
|
||||
} catch (error) {
|
||||
console.error("Error adjusting volume:", error);
|
||||
}
|
||||
}, []);
|
||||
const [previousVolume, setPreviousVolume] = useState<number | null>(null);
|
||||
|
||||
const toggleMuteCb = useCallback(async () => {
|
||||
if (Platform.isTV) return;
|
||||
const { volume } = await VolumeManager.getVolume();
|
||||
const percent = volume * 100;
|
||||
if (percent > 0) {
|
||||
setPreviousVolume(percent);
|
||||
await VolumeManager.setVolume(0);
|
||||
dispatch({ type: "MUTED_CHANGED", value: true });
|
||||
} else {
|
||||
const restore = previousVolume || 50;
|
||||
await VolumeManager.setVolume(restore / 100);
|
||||
setPreviousVolume(null);
|
||||
dispatch({ type: "MUTED_CHANGED", value: false });
|
||||
|
||||
try {
|
||||
const { volume: currentVolume } = await VolumeManager.getVolume();
|
||||
const currentVolumePercent = currentVolume * 100;
|
||||
|
||||
if (currentVolumePercent > 0) {
|
||||
// Currently not muted, so mute
|
||||
setPreviousVolume(currentVolumePercent);
|
||||
await VolumeManager.setVolume(0);
|
||||
setIsMuted(true);
|
||||
} else {
|
||||
// Currently muted, so restore previous volume
|
||||
const volumeToRestore = previousVolume || 50; // Default to 50% if no previous volume
|
||||
await VolumeManager.setVolume(volumeToRestore / 100);
|
||||
setPreviousVolume(null);
|
||||
setIsMuted(false);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error toggling mute:", error);
|
||||
}
|
||||
}, [previousVolume]);
|
||||
const volumeDownCb = useCallback(async () => {
|
||||
if (Platform.isTV) return;
|
||||
|
||||
try {
|
||||
const { volume: currentVolume } = await VolumeManager.getVolume();
|
||||
const newVolume = Math.max(currentVolume - 0.1, 0); // Decrease by 10%
|
||||
console.log(
|
||||
"Volume Down",
|
||||
Math.round(currentVolume * 100),
|
||||
"→",
|
||||
Math.round(newVolume * 100),
|
||||
);
|
||||
await VolumeManager.setVolume(newVolume);
|
||||
} catch (error) {
|
||||
console.error("Error adjusting volume:", error);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const setVolumeCb = useCallback(async (newVolume: number) => {
|
||||
if (Platform.isTV) return;
|
||||
|
||||
try {
|
||||
const clampedVolume = Math.max(0, Math.min(newVolume, 100));
|
||||
console.log("Setting volume to", clampedVolume);
|
||||
await VolumeManager.setVolume(clampedVolume / 100);
|
||||
} catch (error) {
|
||||
console.error("Error setting volume:", error);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useWebSocket({
|
||||
isPlaying: videoState.isPlaying,
|
||||
togglePlay,
|
||||
isPlaying: isPlaying,
|
||||
togglePlay: togglePlay,
|
||||
stopPlayback: stop,
|
||||
offline,
|
||||
toggleMute: toggleMuteCb,
|
||||
@@ -575,44 +441,118 @@ export default function DirectPlayerPage() {
|
||||
setVolume: setVolumeCb,
|
||||
});
|
||||
|
||||
/* Calculate start position in seconds */
|
||||
const startPosition = useMemo(
|
||||
() => (offline ? 0 : ticksToSeconds(getInitialPlaybackTicks())),
|
||||
[offline, getInitialPlaybackTicks],
|
||||
const onPlaybackStateChanged = useCallback(
|
||||
async (e: PlaybackStatePayload) => {
|
||||
const { state, isBuffering, isPlaying } = e.nativeEvent;
|
||||
if (state === "Playing") {
|
||||
setIsPlaying(true);
|
||||
reportPlaybackProgress();
|
||||
if (!Platform.isTV) await activateKeepAwakeAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
if (state === "Paused") {
|
||||
setIsPlaying(false);
|
||||
reportPlaybackProgress();
|
||||
if (!Platform.isTV) await deactivateKeepAwake();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isPlaying) {
|
||||
setIsPlaying(true);
|
||||
setIsBuffering(false);
|
||||
} else if (isBuffering) {
|
||||
setIsBuffering(true);
|
||||
}
|
||||
},
|
||||
[reportPlaybackProgress],
|
||||
);
|
||||
|
||||
/* Conditionally render based on loading and error state */
|
||||
const allAudio =
|
||||
stream?.mediaSource.MediaStreams?.filter(
|
||||
(audio) => audio.Type === "Audio",
|
||||
) || [];
|
||||
|
||||
// Move all the external subtitles last, because vlc places them last.
|
||||
const allSubs =
|
||||
stream?.mediaSource.MediaStreams?.filter(
|
||||
(sub) => sub.Type === "Subtitle",
|
||||
).sort((a, b) => Number(a.IsExternal) - Number(b.IsExternal)) || [];
|
||||
|
||||
const externalSubtitles = allSubs
|
||||
.filter((sub: any) => sub.DeliveryMethod === "External")
|
||||
.map((sub: any) => ({
|
||||
name: sub.DisplayTitle,
|
||||
DeliveryUrl: api?.basePath + sub.DeliveryUrl,
|
||||
}));
|
||||
|
||||
const textSubs = allSubs.filter((sub) => sub.IsTextSubtitleStream);
|
||||
|
||||
const chosenSubtitleTrack = allSubs.find(
|
||||
(sub) => sub.Index === subtitleIndex,
|
||||
);
|
||||
const chosenAudioTrack = allAudio.find((audio) => audio.Index === audioIndex);
|
||||
|
||||
const notTranscoding = !stream?.mediaSource.TranscodingUrl;
|
||||
const initOptions = [`--sub-text-scale=${settings.subtitleSize}`];
|
||||
if (
|
||||
chosenSubtitleTrack &&
|
||||
(notTranscoding || chosenSubtitleTrack.IsTextSubtitleStream)
|
||||
) {
|
||||
const finalIndex = notTranscoding
|
||||
? allSubs.indexOf(chosenSubtitleTrack)
|
||||
: textSubs.indexOf(chosenSubtitleTrack);
|
||||
initOptions.push(`--sub-track=${finalIndex}`);
|
||||
}
|
||||
|
||||
if (notTranscoding && chosenAudioTrack) {
|
||||
initOptions.push(`--audio-track=${allAudio.indexOf(chosenAudioTrack)}`);
|
||||
}
|
||||
|
||||
const [isMounted, setIsMounted] = useState(false);
|
||||
|
||||
// Add useEffect to handle mounting
|
||||
useEffect(() => {
|
||||
setIsMounted(true);
|
||||
return () => setIsMounted(false);
|
||||
}, []);
|
||||
|
||||
// Show error UI first, before checking loading/missing‐data
|
||||
if (itemStatus.isError || streamStatus.isError) {
|
||||
return (
|
||||
<View className='w-screen h-screen items-center justify-center bg-black'>
|
||||
<View className='w-screen h-screen flex flex-col items-center justify-center bg-black'>
|
||||
<Text className='text-white'>{t("player.error")}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
// Then show loader while either side is still fetching or data isn’t present
|
||||
if (itemStatus.isLoading || streamStatus.isLoading || !item || !stream) {
|
||||
// …loader UI…
|
||||
return (
|
||||
<View className='w-screen h-screen items-center justify-center bg-black'>
|
||||
<View className='w-screen h-screen flex flex-col items-center justify-center bg-black'>
|
||||
<Loader />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const allSubs =
|
||||
stream?.mediaSource.MediaStreams?.filter((s) => s.Type === "Subtitle") ||
|
||||
[];
|
||||
const externalSubtitles = allSubs
|
||||
.filter((s) => s.DeliveryMethod === "External")
|
||||
.map((s) => ({
|
||||
name: s.DisplayTitle,
|
||||
DeliveryUrl: api?.basePath + s.DeliveryUrl,
|
||||
}));
|
||||
if (itemStatus.isError || streamStatus.isError)
|
||||
return (
|
||||
<View className='w-screen h-screen flex flex-col items-center justify-center bg-black'>
|
||||
<Text className='text-white'>{t("player.error")}</Text>
|
||||
</View>
|
||||
);
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1, backgroundColor: "black" }}>
|
||||
<View
|
||||
style={{
|
||||
display: "flex",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
position: "relative",
|
||||
flexDirection: "column",
|
||||
justifyContent: "center",
|
||||
paddingLeft: ignoreSafeAreas ? 0 : insets.left,
|
||||
paddingRight: ignoreSafeAreas ? 0 : insets.right,
|
||||
}}
|
||||
@@ -620,20 +560,21 @@ export default function DirectPlayerPage() {
|
||||
<VlcPlayerView
|
||||
ref={videoRef}
|
||||
source={{
|
||||
uri: stream.url,
|
||||
uri: stream?.url || "",
|
||||
autoplay: true,
|
||||
isNetwork: true,
|
||||
startPosition,
|
||||
externalSubtitles,
|
||||
initOptions: optimizedInitOptions,
|
||||
initOptions,
|
||||
}}
|
||||
style={{ width: "100%", height: "100%" }}
|
||||
onVideoProgress={onProgress}
|
||||
progressUpdateInterval={1000}
|
||||
onVideoStateChange={onPlaybackStateChanged}
|
||||
onPipStarted={onPipStarted}
|
||||
// Mark video as loaded on load end to enable player method calls safely
|
||||
onVideoLoadEnd={() => dispatch({ type: "VIDEO_LOADED" })}
|
||||
onVideoLoadEnd={() => {
|
||||
setIsVideoLoaded(true);
|
||||
}}
|
||||
onVideoError={(e) => {
|
||||
console.error("Video Error:", e.nativeEvent);
|
||||
Alert.alert(
|
||||
@@ -644,39 +585,33 @@ export default function DirectPlayerPage() {
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
|
||||
{!videoState.isPipStarted && (
|
||||
{!isPipStarted && isMounted === true && item && (
|
||||
<Controls
|
||||
mediaSource={stream.mediaSource}
|
||||
mediaSource={stream?.mediaSource}
|
||||
item={item}
|
||||
videoRef={videoRef}
|
||||
togglePlay={togglePlay}
|
||||
isPlaying={videoState.isPlaying}
|
||||
isPlaying={isPlaying}
|
||||
isSeeking={isSeeking}
|
||||
progress={progress}
|
||||
cacheProgress={cacheProgress}
|
||||
isBuffering={videoState.isBuffering}
|
||||
isBuffering={isBuffering}
|
||||
showControls={showControls}
|
||||
setShowControls={setShowControls}
|
||||
setIgnoreSafeAreas={setIgnoreSafeAreas}
|
||||
ignoreSafeAreas={ignoreSafeAreas}
|
||||
isVideoLoaded={videoState.isVideoLoaded}
|
||||
startPictureInPicture={startPictureInPicture}
|
||||
play={play}
|
||||
pause={pause}
|
||||
seek={seek}
|
||||
enableTrickplay
|
||||
// Pass undefined for player methods until the video is loaded to avoid crashes
|
||||
getAudioTracks={videoState.isVideoLoaded ? getAudioTracks : undefined}
|
||||
getSubtitleTracks={
|
||||
videoState.isVideoLoaded ? getSubtitleTracks : undefined
|
||||
}
|
||||
isVideoLoaded={isVideoLoaded}
|
||||
startPictureInPicture={videoRef.current?.startPictureInPicture}
|
||||
play={videoRef.current?.play}
|
||||
pause={videoRef.current?.pause}
|
||||
seek={videoRef.current?.seekTo}
|
||||
enableTrickplay={true}
|
||||
getAudioTracks={videoRef.current?.getAudioTracks}
|
||||
getSubtitleTracks={videoRef.current?.getSubtitleTracks}
|
||||
offline={offline}
|
||||
setSubtitleTrack={
|
||||
videoState.isVideoLoaded ? setSubtitleTrack : undefined
|
||||
}
|
||||
setSubtitleURL={videoState.isVideoLoaded ? setSubtitleURL : undefined}
|
||||
setAudioTrack={videoState.isVideoLoaded ? setAudioTrack : undefined}
|
||||
setSubtitleTrack={videoRef.current?.setSubtitleTrack}
|
||||
setSubtitleURL={videoRef.current?.setSubtitleURL}
|
||||
setAudioTrack={videoRef.current?.setAudioTrack}
|
||||
isVlc
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.1.3/schema.json",
|
||||
"files": {
|
||||
"includes": [
|
||||
"**/*",
|
||||
|
||||
38
bun.lock
38
bun.lock
@@ -76,7 +76,7 @@
|
||||
"react-native-uuid": "^2.0.3",
|
||||
"react-native-video": "6.14.1",
|
||||
"react-native-volume-manager": "^2.0.8",
|
||||
"react-native-web": "^0.20.0",
|
||||
"react-native-web": "^0.21.0",
|
||||
"sonner-native": "^0.21.0",
|
||||
"tailwindcss": "3.3.2",
|
||||
"use-debounce": "^10.0.4",
|
||||
@@ -85,7 +85,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@biomejs/biome": "^2.1.4",
|
||||
"@biomejs/biome": "^2.1.3",
|
||||
"@react-native-community/cli": "^19",
|
||||
"@react-native-tvos/config-tv": "^0.1.1",
|
||||
"@types/jest": "^29.5.12",
|
||||
@@ -94,7 +94,7 @@
|
||||
"@types/react-test-renderer": "^19.0.0",
|
||||
"cross-env": "^10.0.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.1.5",
|
||||
"lint-staged": "^16.1.2",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"react-test-renderer": "19.1.1",
|
||||
"typescript": "~5.8.3",
|
||||
@@ -297,23 +297,23 @@
|
||||
|
||||
"@babel/types": ["@babel/types@7.28.2", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ=="],
|
||||
|
||||
"@biomejs/biome": ["@biomejs/biome@2.1.4", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.1.4", "@biomejs/cli-darwin-x64": "2.1.4", "@biomejs/cli-linux-arm64": "2.1.4", "@biomejs/cli-linux-arm64-musl": "2.1.4", "@biomejs/cli-linux-x64": "2.1.4", "@biomejs/cli-linux-x64-musl": "2.1.4", "@biomejs/cli-win32-arm64": "2.1.4", "@biomejs/cli-win32-x64": "2.1.4" }, "bin": { "biome": "bin/biome" } }, "sha512-QWlrqyxsU0FCebuMnkvBIkxvPqH89afiJzjMl+z67ybutse590jgeaFdDurE9XYtzpjRGTI1tlUZPGWmbKsElA=="],
|
||||
"@biomejs/biome": ["@biomejs/biome@2.1.3", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.1.3", "@biomejs/cli-darwin-x64": "2.1.3", "@biomejs/cli-linux-arm64": "2.1.3", "@biomejs/cli-linux-arm64-musl": "2.1.3", "@biomejs/cli-linux-x64": "2.1.3", "@biomejs/cli-linux-x64-musl": "2.1.3", "@biomejs/cli-win32-arm64": "2.1.3", "@biomejs/cli-win32-x64": "2.1.3" }, "bin": { "biome": "bin/biome" } }, "sha512-KE/tegvJIxTkl7gJbGWSgun7G6X/n2M6C35COT6ctYrAy7SiPyNvi6JtoQERVK/VRbttZfgGq96j2bFmhmnH4w=="],
|
||||
|
||||
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.1.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-sCrNENE74I9MV090Wq/9Dg7EhPudx3+5OiSoQOkIe3DLPzFARuL1dOwCWhKCpA3I5RHmbrsbNSRfZwCabwd8Qg=="],
|
||||
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.1.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-LFLkSWRoSGS1wVUD/BE6Nlt2dSn0ulH3XImzg2O/36BoToJHKXjSxzPEMAqT9QvwVtk7/9AQhZpTneERU9qaXA=="],
|
||||
|
||||
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.1.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-gOEICJbTCy6iruBywBDcG4X5rHMbqCPs3clh3UQ+hRKlgvJTk4NHWQAyHOXvaLe+AxD1/TNX1jbZeffBJzcrOw=="],
|
||||
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.1.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-Q/4OTw8P9No9QeowyxswcWdm0n2MsdCwWcc5NcKQQvzwPjwuPdf8dpPPf4r+x0RWKBtl1FLiAUtJvBlri6DnYw=="],
|
||||
|
||||
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.1.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-juhEkdkKR4nbUi5k/KRp1ocGPNWLgFRD4NrHZSveYrD6i98pyvuzmS9yFYgOZa5JhaVqo0HPnci0+YuzSwT2fw=="],
|
||||
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.1.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-2hS6LgylRqMFmAZCOFwYrf77QMdUwJp49oe8PX/O8+P2yKZMSpyQTf3Eo5ewnsMFUEmYbPOskafdV1ds1MZMJA=="],
|
||||
|
||||
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.1.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-nYr7H0CyAJPaLupFE2cH16KZmRC5Z9PEftiA2vWxk+CsFkPZQ6dBRdcC6RuS+zJlPc/JOd8xw3uCCt9Pv41WvQ=="],
|
||||
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.1.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-KXouFSBnoxAWZYDQrnNRzZBbt5s9UJkIm40hdvSL9mBxSSoxRFQJbtg1hP3aa8A2SnXyQHxQfpiVeJlczZt76w=="],
|
||||
|
||||
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.1.4", "", { "os": "linux", "cpu": "x64" }, "sha512-Eoy9ycbhpJVYuR+LskV9s3uyaIkp89+qqgqhGQsWnp/I02Uqg2fXFblHJOpGZR8AxdB9ADy87oFVxn9MpFKUrw=="],
|
||||
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.1.3", "", { "os": "linux", "cpu": "x64" }, "sha512-NxlSCBhLvQtWGagEztfAZ4WcE1AkMTntZV65ZvR+J9jp06+EtOYEBPQndA70ZGhHbEDG57bR6uNvqkd1WrEYVA=="],
|
||||
|
||||
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.1.4", "", { "os": "linux", "cpu": "x64" }, "sha512-lvwvb2SQQHctHUKvBKptR6PLFCM7JfRjpCCrDaTmvB7EeZ5/dQJPhTYBf36BE/B4CRWR2ZiBLRYhK7hhXBCZAg=="],
|
||||
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.1.3", "", { "os": "linux", "cpu": "x64" }, "sha512-KaLAxnROouzIWtl6a0Y88r/4hW5oDUJTIqQorOTVQITaKQsKjZX4XCUmHIhdEk8zMnaiLZzRTAwk1yIAl+mIew=="],
|
||||
|
||||
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.1.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-3WRYte7orvyi6TRfIZkDN9Jzoogbv+gSvR+b9VOXUg1We1XrjBg6WljADeVEaKTvOcpVdH0a90TwyOQ6ue4fGw=="],
|
||||
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.1.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-V9CUZCtWH4u0YwyCYbQ3W5F4ZGPWp2C2TYcsiWFNNyRfmOW1j/TY/jAurl33SaRjgZPO5UUhGyr9m6BN9t84NQ=="],
|
||||
|
||||
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.1.4", "", { "os": "win32", "cpu": "x64" }, "sha512-tBc+W7anBPSFXGAoQW+f/+svkpt8/uXfRwDzN1DvnatkRMt16KIYpEi/iw8u9GahJlFv98kgHcIrSsZHZTR0sw=="],
|
||||
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.1.3", "", { "os": "win32", "cpu": "x64" }, "sha512-dxy599q6lgp8ANPpR8sDMscwdp9oOumEsVXuVCVT9N2vAho8uYXlCz53JhxX6LtJOXaE73qzgkGQ7QqvFlMC0g=="],
|
||||
|
||||
"@bottom-tabs/react-navigation": ["@bottom-tabs/react-navigation@0.9.2", "", { "dependencies": { "color": "^4.2.3" }, "peerDependencies": { "@react-navigation/native": ">=7", "react": "*", "react-native": "*", "react-native-bottom-tabs": "*" } }, "sha512-IZZKllcaqCGsKIgeXmYFGU95IXxbBpXtwKws4Lg2GJw/qqAYYsPFEl0JBvnymSD7G1zkHYEilg5UHuTd0NmX7A=="],
|
||||
|
||||
@@ -1335,9 +1335,9 @@
|
||||
|
||||
"lines-and-columns": ["lines-and-columns@1.2.4", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="],
|
||||
|
||||
"lint-staged": ["lint-staged@16.1.5", "", { "dependencies": { "chalk": "^5.5.0", "commander": "^14.0.0", "debug": "^4.4.1", "lilconfig": "^3.1.3", "listr2": "^9.0.1", "micromatch": "^4.0.8", "nano-spawn": "^1.0.2", "pidtree": "^0.6.0", "string-argv": "^0.3.2", "yaml": "^2.8.1" }, "bin": { "lint-staged": "bin/lint-staged.js" } }, "sha512-uAeQQwByI6dfV7wpt/gVqg+jAPaSp8WwOA8kKC/dv1qw14oGpnpAisY65ibGHUGDUv0rYaZ8CAJZ/1U8hUvC2A=="],
|
||||
"lint-staged": ["lint-staged@16.1.2", "", { "dependencies": { "chalk": "^5.4.1", "commander": "^14.0.0", "debug": "^4.4.1", "lilconfig": "^3.1.3", "listr2": "^8.3.3", "micromatch": "^4.0.8", "nano-spawn": "^1.0.2", "pidtree": "^0.6.0", "string-argv": "^0.3.2", "yaml": "^2.8.0" }, "bin": { "lint-staged": "bin/lint-staged.js" } }, "sha512-sQKw2Si2g9KUZNY3XNvRuDq4UJqpHwF0/FQzZR2M7I5MvtpWvibikCjUVJzZdGE0ByurEl3KQNvsGetd1ty1/Q=="],
|
||||
|
||||
"listr2": ["listr2@9.0.1", "", { "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", "log-update": "^6.1.0", "rfdc": "^1.4.1", "wrap-ansi": "^9.0.0" } }, "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g=="],
|
||||
"listr2": ["listr2@8.3.3", "", { "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", "log-update": "^6.1.0", "rfdc": "^1.4.1", "wrap-ansi": "^9.0.0" } }, "sha512-LWzX2KsqcB1wqQ4AHgYb4RsDXauQiqhjLk+6hjbaeHG4zpjjVAB6wC/gz6X0l+Du1cN3pUB5ZlrvTbhGSNnUQQ=="],
|
||||
|
||||
"locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="],
|
||||
|
||||
@@ -1663,7 +1663,7 @@
|
||||
|
||||
"react-native-volume-manager": ["react-native-volume-manager@2.0.8", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-aZM47/mYkdQ4CbXpKYO6Ajiczv7fxbQXZ9c0H8gRuQUaS3OCz/MZABer6o9aDWq0KMNsQ7q7GVFLRPnSSeeMmw=="],
|
||||
|
||||
"react-native-web": ["react-native-web@0.20.0", "", { "dependencies": { "@babel/runtime": "^7.18.6", "@react-native/normalize-colors": "^0.74.1", "fbjs": "^3.0.4", "inline-style-prefixer": "^7.0.1", "memoize-one": "^6.0.0", "nullthrows": "^1.1.1", "postcss-value-parser": "^4.2.0", "styleq": "^0.1.3" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-OOSgrw+aON6R3hRosCau/xVxdLzbjEcsLysYedka0ZON4ZZe6n9xgeN9ZkoejhARM36oTlUgHIQqxGutEJ9Wxg=="],
|
||||
"react-native-web": ["react-native-web@0.21.0", "", { "dependencies": { "@babel/runtime": "^7.18.6", "@react-native/normalize-colors": "^0.74.1", "fbjs": "^3.0.4", "inline-style-prefixer": "^7.0.1", "memoize-one": "^6.0.0", "nullthrows": "^1.1.1", "postcss-value-parser": "^4.2.0", "styleq": "^0.1.3" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-S0mtV7wMPeet1kCRnrEmo1bTUJeFsKebleCbRwbBRBUg/BWS64bfsnnm+ArC+QtjlbZFSZmtvv8imzOIuOOa3Q=="],
|
||||
|
||||
"react-refresh": ["react-refresh@0.14.2", "", {}, "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA=="],
|
||||
|
||||
@@ -1987,7 +1987,7 @@
|
||||
|
||||
"yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],
|
||||
|
||||
"yaml": ["yaml@2.8.1", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw=="],
|
||||
"yaml": ["yaml@2.8.0", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ=="],
|
||||
|
||||
"yargs": ["yargs@17.7.2", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="],
|
||||
|
||||
@@ -2081,8 +2081,6 @@
|
||||
|
||||
"@react-native-community/cli-doctor/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="],
|
||||
|
||||
"@react-native-community/cli-doctor/yaml": ["yaml@2.8.0", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ=="],
|
||||
|
||||
"@react-native-community/cli-server-api/pretty-format": ["pretty-format@26.6.2", "", { "dependencies": { "@jest/types": "^26.6.2", "ansi-regex": "^5.0.0", "ansi-styles": "^4.0.0", "react-is": "^17.0.1" } }, "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg=="],
|
||||
|
||||
"@react-native-community/cli-tools/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="],
|
||||
@@ -2169,7 +2167,7 @@
|
||||
|
||||
"lighthouse-logger/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
|
||||
|
||||
"lint-staged/chalk": ["chalk@5.5.0", "", {}, "sha512-1tm8DTaJhPBG3bIkVeZt1iZM9GfSX2lzOeDVZH9R9ffRHpmHvxZ/QhgQH/aDTkswQVt+YHdXAdS/In/30OjCbg=="],
|
||||
"lint-staged/chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="],
|
||||
|
||||
"lint-staged/commander": ["commander@14.0.0", "", {}, "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA=="],
|
||||
|
||||
@@ -2203,8 +2201,6 @@
|
||||
|
||||
"postcss-css-variables/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
|
||||
|
||||
"postcss-load-config/yaml": ["yaml@2.8.0", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ=="],
|
||||
|
||||
"pretty-format/ansi-styles": ["ansi-styles@5.2.0", "", {}, "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA=="],
|
||||
|
||||
"pretty-format/react-is": ["react-is@18.3.1", "", {}, "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="],
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
"react-native-uuid": "^2.0.3",
|
||||
"react-native-video": "6.14.1",
|
||||
"react-native-volume-manager": "^2.0.8",
|
||||
"react-native-web": "^0.20.0",
|
||||
"react-native-web": "^0.21.0",
|
||||
"sonner-native": "^0.21.0",
|
||||
"tailwindcss": "3.3.2",
|
||||
"use-debounce": "^10.0.4",
|
||||
@@ -100,7 +100,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@biomejs/biome": "^2.1.4",
|
||||
"@biomejs/biome": "^2.1.3",
|
||||
"@react-native-community/cli": "^19",
|
||||
"@react-native-tvos/config-tv": "^0.1.1",
|
||||
"@types/jest": "^29.5.12",
|
||||
@@ -109,7 +109,7 @@
|
||||
"@types/react-test-renderer": "^19.0.0",
|
||||
"cross-env": "^10.0.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.1.5",
|
||||
"lint-staged": "^16.1.2",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"react-test-renderer": "19.1.1",
|
||||
"typescript": "~5.8.3"
|
||||
|
||||
Reference in New Issue
Block a user