diff --git a/app/(auth)/player/direct-player.tsx b/app/(auth)/player/direct-player.tsx index 370150a7..b0997e88 100644 --- a/app/(auth)/player/direct-player.tsx +++ b/app/(auth)/player/direct-player.tsx @@ -342,22 +342,11 @@ export default function page() { : 0; }, [item]); - const backAction = () => { - videoRef.current?.stop(); - return false; - }; - useFocusEffect( React.useCallback(() => { - const onBackPress = () => { - return backAction(); - }; - - BackHandler.addEventListener("hardwareBackPress", onBackPress); - return async () => { - videoRef.current?.stop(); - BackHandler.removeEventListener("hardwareBackPress", onBackPress); + stop(); + console.log("Unmounted"); }; }, []) ); diff --git a/components/video-player/controls/Controls.tsx b/components/video-player/controls/Controls.tsx index f7b7940d..6460557a 100644 --- a/components/video-player/controls/Controls.tsx +++ b/components/video-player/controls/Controls.tsx @@ -526,7 +526,6 @@ export const Controls: React.FC = ({ )} { - if (stop) await stop(); router.back(); }} className="aspect-square flex flex-col bg-neutral-800/90 rounded-xl items-center justify-center p-2" diff --git a/components/video-player/controls/EpisodeList.tsx b/components/video-player/controls/EpisodeList.tsx index 78127865..c40983b2 100644 --- a/components/video-player/controls/EpisodeList.tsx +++ b/components/video-player/controls/EpisodeList.tsx @@ -192,106 +192,97 @@ export const EpisodeList: React.FC = ({ item, close }) => { backgroundColor: "black", }} > - {isFetching ? ( - - - - ) : ( - <> - - {seriesItem && ( - { - setSeasonIndexState((prev) => ({ - ...prev, - [item.SeriesId ?? ""]: season.IndexNumber, - })); - }} - /> - )} - { - close(); + <> + + {seriesItem && ( + { + setSeasonIndexState((prev) => ({ + ...prev, + [item.SeriesId ?? ""]: season.IndexNumber, + })); }} - className="aspect-square flex flex-col bg-neutral-800/90 rounded-xl items-center justify-center p-2" - > - - - - + )} + { + close(); }} + className="aspect-square flex flex-col bg-neutral-800/90 rounded-xl items-center justify-center p-2" > - ( - + + + + ( + + { + gotoEpisode(_item.Id); + }} > - { - gotoEpisode(_item.Id); + + + + - - - - - {_item.Name} - - - {`S${_item.ParentIndexNumber?.toString()}:E${_item.IndexNumber?.toString()}`} - - - {runtimeTicksToSeconds(_item.RunTimeTicks)} - - - - - - - {_item.Overview} + {_item.Name} + + + {`S${_item.ParentIndexNumber?.toString()}:E${_item.IndexNumber?.toString()}`} + + + {runtimeTicksToSeconds(_item.RunTimeTicks)} - )} - keyExtractor={(e: BaseItemDto) => e.Id ?? ""} - estimatedItemSize={200} - showsHorizontalScrollIndicator={false} - /> - - - )} + + + + + {_item.Overview} + + + )} + keyExtractor={(e: BaseItemDto) => e.Id ?? ""} + estimatedItemSize={200} + showsHorizontalScrollIndicator={false} + /> + + ); };