Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8d0af7a74aebae5d49c28a6a1f8251e744f995ee
https://github.com/WebKit/WebKit/commit/8d0af7a74aebae5d49c28a6a1f8251e744f995ee
Author: Phinehas Fuachie <[email protected]>
Date: 2026-09-02 (Wed, 02 Sep 2026)
Changed paths:
M Source/WebCore/Modules/modern-media-controls/media/YouTubeCaptionQuirk.js
Log Message:
-----------
YouTube captions freeze on the previous video's text in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=323189
rdar://186384656
Reviewed by Jean-Yves Avenard.
Enabling captions inline, entering fullscreen, then going back inline and
playing a different video
left a frozen caption frame on screen in fullscreen showing the earlier video's
text, and it
reappeared every subsequent time that video was put into fullscreen.
CaptionMirror scrapes YouTube's in-page caption windows into a hidden text
track that the system
displays in fullscreen. Its
cues are created with an effectively infinite end time, so they only go
away when something removes them, and the only thing that removed them was a
MutationObserver bound
to the single .ytp-caption-window-container node found at setup. Nothing
re-attached that observer
when YouTube replaced the container, and the wait observer disconnected
permanently after its first
success, so the cues stopped being updated and stayed active forever. Entering
fullscreen then
flipped the track to 'showing' without re-syncing, displaying whichever stale
cue was added last.
Re-resolve the container before every sync and re-attach the observer when it
has changed, drop the
cues when the media resource changes, and re-sync before making the mirror
track visible.
*
Source/WebCore/Modules/modern-media-controls/media/YouTubeCaptionQuirk.js:
(CaptionMirror):
(CaptionMirror.prototype.invalidate):
(CaptionMirror.prototype._handleCaptionStateChanged):
(CaptionMirror.prototype._handleResourceChanged):
(CaptionMirror.prototype._updateCues):
(CaptionMirror.prototype._removeAllCues):
(CaptionMirror.prototype._syncCues):
(CaptionMirror.prototype._attachCaptionWindowObserver):
(CaptionMirror.prototype._detachCaptionObserver):
(CaptionMirror.prototype._attachCaptionObserver):
(CaptionMirror.prototype._handlePresentationModeChanged):
Canonical link:
https://flagged.apple.com:443/proxy?t2=DQ3n7N7AR8&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzIwMzQ1QG1haW4=&emid=bb5ac527-667e-4b61-9da9-c27e00c75c21&c=11
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications