Commit f1dfb34
[visionOS][Quirk] Duplicate YouTube captions after undocking from system environment fullscreen
https://bugs.webkit.org/show_bug.cgi?id=316035
rdar://178235422
Reviewed by Jer Noble.
YouTubeCaptionQuirk.js has a strict-mode syntax error (cue.positionAlign = = 'center';) that
prevents the script from loading, so the in-page caption mirror has been inactive in native
fullscreen and PIP on every platform.
On visionOS the script is further hobbled because VideoPresentationModeAPIEnabled is off by
default, so video.webkitPresentationMode reads as undefined. The script never sees the transition
back to inline on undock, leaves the mirror text track showing with stale cues, and those cues
overlap YouTube's restored in-page captions.
Rather than enable VideoPresentationModeAPIEnabled on visionOS (which would also expose
webkitSetPresentationMode and let pages programmatically request PIP on a platform that doesn't
support it), feature-detect the property and fall back to the always-exposed read-only
video.webkitDisplayingFullscreen on visionOS.
* Source/WebCore/Modules/modern-media-controls/media/YouTubeCaptionQuirk.js:
(CaptionMirror.prototype._syncCues):
(CaptionMirror.prototype._getIsInline):
(CaptionMirror.prototype._handlePresentationModeChanged):
Canonical link: https://commits.webkit.org/314345@main1 parent d06ccb1 commit f1dfb34
1 file changed
Lines changed: 8 additions & 2 deletions
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
165 | 171 | | |
166 | | - | |
| 172 | + | |
167 | 173 | | |
168 | 174 | | |
169 | 175 | | |
| |||
0 commit comments