Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7de5451e6e8e2bce65575c7feb8fd945b07b004f
      
https://github.com/WebKit/WebKit/commit/7de5451e6e8e2bce65575c7feb8fd945b07b004f
  Author: Jer Noble <[email protected]>
  Date:   2026-04-14 (Tue, 14 Apr 2026)

  Changed paths:
    M Source/WebCore/CMakeLists.txt
    M Source/WebCore/DerivedSources-input.xcfilelist
    M Source/WebCore/DerivedSources-output.xcfilelist
    M Source/WebCore/DerivedSources.make
    M Source/WebCore/Modules/mediasession/MediaSession.cpp
    M Source/WebCore/Modules/mediasession/MediaSession.h
    M Source/WebCore/Modules/mediasession/MediaSession.idl
    M Source/WebCore/Modules/mediasession/MediaSessionAction.h
    M Source/WebCore/Modules/mediasession/MediaSessionAction.idl
    M Source/WebCore/Modules/mediasession/MediaSessionActionDetails.h
    M Source/WebCore/Modules/mediasession/MediaSessionActionDetails.idl
    A Source/WebCore/Modules/mediasession/MediaSessionCaptionTrack.h
    A Source/WebCore/Modules/mediasession/MediaSessionCaptionTrack.idl
    A Source/WebCore/Modules/modern-media-controls/media/YouTubeCaptionQuirk.js
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/dom/DocumentMediaElement.cpp
    M Source/WebCore/dom/DocumentMediaElement.h
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLMediaElement.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Quirks.cpp
    M Source/WebCore/page/Quirks.h
    M Source/WebCore/page/QuirksData.h
    M Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h
    M Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm
    M Source/WebCore/rendering/RenderTheme.h
    M Source/WebCore/rendering/cocoa/RenderThemeCocoa.h
    M Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm

  Log Message:
  -----------
  [Quirk] Mirror YouTube in-page captions in native fullscreen modes
https://bugs.webkit.org/show_bug.cgi?id=312229
rdar://174708144

Reviewed by Jean-Yves Avenard.

Add a quirked behavior for YouTube which allows captions rendered atop the
video element to be "mirrored" into the video itself when in out-of-page
rendering modes like fullscreen and picture-in-picture. This quirk also
supports pushing track information down from YouTube's player API via
a quirked MediaSession metadata, and supports pushing track changes up
to that same player API via a quirked MediaSession action handler.

Key Changes:
- MediaSessionAction.{h,idl}: add two new action enum values.
- MediaSessionCaptionTrack.{h,idl}: add a new dictionary definition
  used by the quirk to pass caption track information down to WebCore.
- MediaSession.{h,cpp,idl}: add new action handlers for sending commands
  up to the YouTube player API via the quirk.
- MediaSessionActionDetails,{h,cpp}: add a new trackIndex value to the
  MediaSessionActionDetails dictionary when sending a "selectcaptiontrack"
  action.
- YouTubeCaptionQuirk.js: this is the main quirk script; it bridges the
  YouTube player API and the MediaSession, and implements the "mirror"
  by using a MutationObserver to detect cues being added and removed from
  YouTube's caption window.
- Page.cpp: notify the MediaSession object when caption preferences change.
- DocumentMediaElement.{h,cpp}: add convienience methods for setting up the
  quirk script and for calling methods on that script.
- Quirks{.h,.cpp,Data.h}: add the quirk itself.
- PlaybackSessionModelMediaElement.{h,cpp}: when the quirk is active, returns
  caption track data from MediaSession rather than the media element.

Canonical link: https://commits.webkit.org/311248@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to