fix(web): keep playback running during next up

This commit is contained in:
Quick
2026-07-10 14:17:17 -04:00
parent 02b6648995
commit df9cacc8da
2 changed files with 3 additions and 20 deletions
+3 -8
View File
@@ -710,8 +710,8 @@ export function WatchPlaybackHost() {
return;
}
// If already in post-roll (triggered early), just mark video as ended
// so PlayingNextScreen can start its autoplay countdown.
// If post-roll was shown before the video ended, wait for the real
// `ended` event before starting the autoplay countdown.
if (modeRef.current === "post-roll") {
setPostRollVideoEnded(true);
return;
@@ -775,12 +775,7 @@ export function WatchPlaybackHost() {
snapshot.duration - snapshot.currentTime <= POST_ROLL_SECONDS_BEFORE_END
) {
postRollEnteredRef.current = true;
// Entering post-roll early pauses the underlying video to stop HLS from
// buffering the tail segment (see VideoPlayer's post-roll pause effect).
// A paused video never fires `ended`, so we must arm the autoplay
// countdown here rather than waiting for an `ended` event that will
// never arrive — otherwise the overlay shows but the countdown stalls.
setPostRollVideoEnded(true);
setPostRollVideoEnded(false);
controller.enterPostRoll(requestKeyValue);
}
},
-12
View File
@@ -1150,18 +1150,6 @@ export function VideoPlayer({
}
}, [cancelNextEpisodeAutoPlay, displayMode]);
// Pause the underlying video when the post-roll overlay takes over so HLS
// stops buffering the tail segment. Without this, on end-of-series the
// player can visibly loop the last few seconds of the file while waiting
// for an `ended` event that HLS may never deliver cleanly.
useEffect(() => {
if (displayMode !== "postroll") return;
const video = videoRef.current;
if (video && !video.paused) {
video.pause();
}
}, [displayMode]);
// -- Intro skip --
const showIntroSkip = intro != null && currentTime >= intro.start && currentTime < intro.end;
const showRecapSkip = recap != null && currentTime >= recap.start && currentTime < recap.end;