diff --git a/web/src/playback/WatchPlaybackChrome.tsx b/web/src/playback/WatchPlaybackChrome.tsx index 795f2352..6bad4471 100644 --- a/web/src/playback/WatchPlaybackChrome.tsx +++ b/web/src/playback/WatchPlaybackChrome.tsx @@ -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); } }, diff --git a/web/src/player/components/VideoPlayer.tsx b/web/src/player/components/VideoPlayer.tsx index 2955dd76..9d557fbb 100644 --- a/web/src/player/components/VideoPlayer.tsx +++ b/web/src/player/components/VideoPlayer.tsx @@ -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;