Fix android auto not selected by default

This commit is contained in:
Zoe Roux 2024-02-01 00:57:29 +01:00
parent 0fbfd5731d
commit 1abee46f6d

View File

@ -70,9 +70,10 @@ const Video = forwardRef<VideoRef, VideoProps>(function Video(
const { css } = useYoshiki();
const token = useRef<string | null>(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<VideoRef, VideoProps>(function Video(
run();
}, [source]);
useEffect(() => {
if (mode === PlayMode.Hls) setVideo(-1);
}, [mode, setVideo]);
return (
<View {...css({ flexGrow: 1, flexShrink: 1 })}>
<NativeVideo