fix(startTime): fix start time on web

This commit is contained in:
2026-08-14 16:50:31 +02:00
parent 1dbffadb62
commit ba7a2b6a6d
3 changed files with 55 additions and 14 deletions
+11
View File
@@ -134,6 +134,17 @@ export const OmniView = ({
[],
);
const player = usePlayer();
const uri = source?.src.uri;
const startTime = source?.startTime;
const prevUri = useRef<string | undefined>(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 <video>.
const castStatus = usePlayerState("castStatus");