Fix start time not working when trying to play pristine without success

This commit is contained in:
Zoe Roux 2024-01-31 12:35:28 +01:00
parent fab2784e16
commit e06989f2ae
2 changed files with 2 additions and 4 deletions

View File

@ -133,9 +133,7 @@ export const TouchControls = ({
/> />
<IconButton <IconButton
icon={isPlaying ? Pause : PlayArrow} icon={isPlaying ? Pause : PlayArrow}
onPress={() => { onPress={() => setPlay(!isPlaying)}
console.log("play pressed")
setPlay(!isPlaying)}}
size={ts(8)} size={ts(8)}
{...common} {...common}
/> />

View File

@ -122,7 +122,7 @@ export const Video = memo(function Video({
}, [publicProgress]); }, [publicProgress]);
const getProgress = useAtomCallback(useCallback((get) => get(progressAtom), [])); const getProgress = useAtomCallback(useCallback((get) => get(progressAtom), []));
const oldLinks = useRef(links); const oldLinks = useRef<typeof links | null>(null);
useLayoutEffect(() => { useLayoutEffect(() => {
// Reset the state when a new video is loaded. // Reset the state when a new video is loaded.
setSource((mode === PlayMode.Direct ? links?.direct : links?.hls) ?? null); setSource((mode === PlayMode.Direct ? links?.direct : links?.hls) ?? null);