From 88410ca19d2b9147d89d234615a869111514143c Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 14 Aug 2026 20:31:07 +0200 Subject: [PATCH] fix(web): fix start time handling --- src/view.web.tsx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/view.web.tsx b/src/view.web.tsx index 66763a1..490e58d 100644 --- a/src/view.web.tsx +++ b/src/view.web.tsx @@ -119,9 +119,11 @@ export const OmniView = ({ const headersRef = useRef(source?.src?.headers); headersRef.current = source?.src?.headers; + const startTime = source?.startTime; const config = useMemo( () => ({ hlsJs: { + ...(startTime && { startPosition: startTime }), xhrSetup: (xhr: XMLHttpRequest) => { const headers = headersRef.current; if (!headers) return; @@ -131,20 +133,9 @@ export const OmniView = ({ }, }, }), - [], + [startTime], ); - const player = usePlayer(); - const uri = source?.src.uri; - const startTime = source?.startTime; - const prevUri = useRef(undefined); - useEffect(() => { - if (!uri) return; - if (startTime) player.currentTime = startTime; - if (autoplay && prevUri.current && prevUri.current !== uri) player.play(); - prevUri.current = uri; - }, [player, uri, startTime, autoplay]); - // While casting, the receiver renders subtitles (the player forwards the // selection); skip rendering them locally on the idle