From 4d4bb0f6a40361e718cf87900854de5598b5df64 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Wed, 21 Aug 2024 20:21:00 +0200 Subject: [PATCH] chore --- app/(auth)/items/[id].tsx | 50 +-------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/app/(auth)/items/[id].tsx b/app/(auth)/items/[id].tsx index 373110e5..9a2224ad 100644 --- a/app/(auth)/items/[id].tsx +++ b/app/(auth)/items/[id].tsx @@ -55,13 +55,6 @@ const page: React.FC = () => { const castDevice = useCastDevice(); - const [, setCurrentlyPlying] = useAtom(currentlyPlayingItemAtom); - const [, setShowCurrentlyPlayingBar] = useAtom(showCurrentlyPlayingBarAtom); - const [, setPlaying] = useAtom(playingAtom); - const [, setFullscreen] = useAtom(fullScreenAtom); - - const client = useRemoteMediaClient(); - const chromecastReady = useMemo(() => !!castDevice?.deviceId, [castDevice]); const [selectedAudioStream, setSelectedAudioStream] = useState(-1); const [selectedSubtitleStream, setSelectedSubtitleStream] = useState(0); @@ -141,47 +134,6 @@ const page: React.FC = () => { staleTime: 0, }); - const onPressPlay = useCallback( - async (type: "device" | "cast" = "device") => { - if (!playbackUrl || !item) return; - - if (type === "cast" && client) { - await CastContext.getPlayServicesState().then((state) => { - if (state && state !== PlayServicesState.SUCCESS) - CastContext.showPlayServicesErrorDialog(state); - else { - client.loadMedia({ - mediaInfo: { - contentUrl: playbackUrl, - contentType: "video/mp4", - metadata: { - type: item.Type === "Episode" ? "tvShow" : "movie", - title: item.Name || "", - subtitle: item.Overview || "", - }, - }, - startTime: 0, - }); - } - }); - } else { - setCurrentlyPlying({ - item, - playbackUrl, - }); - setPlaying(true); - setShowCurrentlyPlayingBar(true); - - if (settings?.openFullScreenVideoPlayerByDefault === true) { - setTimeout(() => { - setFullscreen(true); - }, 100); - } - } - }, - [playbackUrl, item, settings] - ); - const backdropUrl = useMemo( () => getBackdropUrl({ @@ -252,7 +204,7 @@ const page: React.FC = () => { {playbackUrl ? ( - + ) : ( )}