From 1abee46f6df527978bbd52ecae7b538988e8249b Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 1 Feb 2024 00:57:29 +0100 Subject: [PATCH] Fix android auto not selected by default --- front/packages/ui/src/player/video.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/front/packages/ui/src/player/video.tsx b/front/packages/ui/src/player/video.tsx index 7a5bfcc14..c8a137f69 100644 --- a/front/packages/ui/src/player/video.tsx +++ b/front/packages/ui/src/player/video.tsx @@ -70,9 +70,10 @@ const Video = forwardRef(function Video( const { css } = useYoshiki(); const token = useRef(null); const setInfo = useSetAtom(infoAtom); - const video = useAtomValue(videoAtom); + const [video, setVideo] = useAtom(videoAtom); const audio = useAtomValue(audioAtom); const subtitle = useAtomValue(subtitleAtom); + const mode = useAtomValue(playModeAtom); useEffect(() => { async function run() { @@ -81,6 +82,10 @@ const Video = forwardRef(function Video( run(); }, [source]); + useEffect(() => { + if (mode === PlayMode.Hls) setVideo(-1); + }, [mode, setVideo]); + return (