Skip to content

Commit

Permalink
Fix android auto not selected by default
Browse files Browse the repository at this point in the history
  • Loading branch information
zoriya committed Feb 1, 2024
1 parent 0fbfd57 commit 1abee46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion front/packages/ui/src/player/video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand Down

0 comments on commit 1abee46

Please sign in to comment.