Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bbbe0dd620c3e17ee2b7c1b2be04fd449b42d4f7
      
https://github.com/WebKit/WebKit/commit/bbbe0dd620c3e17ee2b7c1b2be04fd449b42d4f7
  Author: Andy Estes <[email protected]>
  Date:   2026-01-23 (Fri, 23 Jan 2026)

  Changed paths:
    A 
LayoutTests/media/wireless-playback-media-player/remote-playback-connect-mms-fallback-expected.txt
    A 
LayoutTests/media/wireless-playback-media-player/remote-playback-connect-mms-fallback.html
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLMediaElement.h
    M Source/WebCore/platform/audio/ios/MediaSessionHelperIOS.mm
    M Source/WebCore/platform/graphics/MediaPlaybackTarget.h
    M Source/WebCore/platform/graphics/MediaPlaybackTargetWirelessPlayback.cpp
    M Source/WebCore/platform/graphics/MediaPlaybackTargetWirelessPlayback.h
    M Source/WebCore/platform/graphics/MediaPlayer.cpp
    M Source/WebCore/platform/graphics/MediaPlayer.h
    M Source/WebCore/platform/graphics/MediaPlayerEnums.h
    M Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.cpp
    M Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.h
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm
    M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
    M Source/WebKit/Platform/cocoa/MediaPlaybackTargetContextSerialized.mm
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/WebPreferences.cpp
    M Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp
    M Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.h

  Log Message:
  -----------
  [iOS] ManagedMediaSource videos should fall back to an AirPlay-compatible 
source when a MediaDeviceRoute activates
https://bugs.webkit.org/show_bug.cgi?id=306052
rdar://168692949

Reviewed by Jer Noble.

When a video has a ManagedMediaSource source and a MediaDeviceRoute activates, 
we should fall back
to an AirPlay-compatible source. This change makes it so.

Test: 
media/wireless-playback-media-player/remote-playback-connect-mms-fallback.html

* 
LayoutTests/media/wireless-playback-media-player/remote-playback-connect-mms-fallback-expected.txt:
 Added.
* 
LayoutTests/media/wireless-playback-media-player/remote-playback-connect-mms-fallback.html:
 Added.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playbackTargetType const):
  Implemented to conform to MediaPlayerClient so that 
MediaPlayer::nextBestMediaEngine can populate
  MediaEngineSupportParameters::playbackTargetType.

* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/platform/audio/ios/MediaSessionHelperIOS.mm:

* Source/WebCore/platform/graphics/MediaPlaybackTarget.h:
  Moved MediaPlaybackTargetType to MediaPlayerEnums.h so that MediaPlayer.h 
doesn't need to include
  MediaPlaybackTarget.h.

* Source/WebCore/platform/graphics/MediaPlaybackTargetWirelessPlayback.cpp:
(WebCore::MediaPlaybackTargetWirelessPlayback::create):
(WebCore::MediaPlaybackTargetWirelessPlayback::MediaPlaybackTargetWirelessPlayback):
(WebCore::MediaPlaybackTargetWirelessPlayback::route const):
(WebCore::MediaPlaybackTargetWirelessPlayback::hasActiveRoute const): Deleted.
* Source/WebCore/platform/graphics/MediaPlaybackTargetWirelessPlayback.h:

* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::nextBestMediaEngine):
  Populated MediaEngineSupportParameters::playbackTargetType with the required 
playback target type
  from the client.

(WebCore::MediaPlayer::playbackTargetType const):
* Source/WebCore/platform/graphics/MediaPlayer.h:
* Source/WebCore/platform/graphics/MediaPlayerEnums.h:
* Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.cpp:
  Implemented supportsTypeAndCodecs such that 
MediaPlayer::SupportsType::IsSupported is returned
  iff the playback target type is WirelessPlayback.

(WebCore::MediaPlayerPrivateWirelessPlayback::load):
(WebCore::MediaPlayerPrivateWirelessPlayback::playbackTargetTypes):
(WebCore::MediaPlayerPrivateWirelessPlayback::wirelessPlaybackTargetName const):
(WebCore::MediaPlayerPrivateWirelessPlayback::wirelessPlaybackTargetType const):
(WebCore::MediaPlayerPrivateWirelessPlayback::supportedPlaybackTargetTypes 
const):
(WebCore::MediaPlayerPrivateWirelessPlayback::isCurrentPlaybackTargetWireless 
const):
(WebCore::MediaPlayerPrivateWirelessPlayback::setWirelessPlaybackTarget):
(WebCore::MediaPlayerPrivateWirelessPlayback::setShouldPlayToPlaybackTarget):
(WebCore::MediaPlayerPrivateWirelessPlayback::updateURLStringIfNeeded):
  Implemented MediaPlayerPrivateInterface methods guarded by 
ENABLE(WIRELESS_PLAYBACK_TARGET) and
  provided a stub implementation of MediaPlayerPrivateInterface::load.

* Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.h:
* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:

* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsTypeAndCodecs):
  Returned MediaPlayer::SupportsType::IsNotSupported if 
parameters.playbackTargetType is not in
  playbackTargetTypes().

(WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless 
const):
(WebCore::externalDeviceDisplayNameForPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportedPlaybackTargetTypes 
const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::playbackTargetTypes):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
  Modified to work properly on iOS when HAVE(AVROUTING_FRAMEWORK) is true.

(WebCore::exernalDeviceDisplayNameForPlayer):
  Fixed a typo in the function name.

* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsTypeAndCodecs):
  Returned MediaPlayer::SupportsType::IsNotSupported if 
parameters.playbackTargetType is
  WirelessPlayback.

* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType):
  Ditto.

* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::MediaPlayerPrivateWebM::supportsType):
  Ditto.

* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::playbackTargetType const):
  Implemented to conform to MediaPlayerClient so that 
MediaPlayer::nextBestMediaEngine can populate
  MediaEngineSupportParameters::playbackTargetType.

* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h:
* Source/WebKit/Platform/cocoa/MediaPlaybackTargetContextSerialized.mm:
(WebKit::MediaPlaybackTargetContextSerialized::playbackTarget const):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::update):

* Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp:
(WebKit::RemoteMediaPlayerMIMETypeCache::supportsTypeAndCodecs):
* Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.h:
  Added a WebCore::MediaPlaybackTargetType to the SupportedTypesAndCodecsKey 
tuple so that
  playbackTargetType can be considered when invalidating the RemoteMediaPlayer 
MIME type cache.

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



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

Reply via email to