Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 377a419a0a7dbe929f591bfd67ef4f80c0ec3425
      
https://github.com/WebKit/WebKit/commit/377a419a0a7dbe929f591bfd67ef4f80c0ec3425
  Author: Andy Estes <[email protected]>
  Date:   2026-02-14 (Sat, 14 Feb 2026)

  Changed paths:
    M Source/WebCore/platform/audio/ios/MediaSessionHelperIOS.mm
    M Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.cpp

  Log Message:
  -----------
  [iOS] MediaSessionHelper::activeVideoRouteDidChange is called twice when an 
AirPlay route activates
https://bugs.webkit.org/show_bug.cgi?id=307842
rdar://170341830

Reviewed by Eric Carlson.

When an AirPlay route activates and WirelessPlaybackMediaPlayerEnabled is 
enabled,
MediaSessionHelper learns about the new route via activeRoutesDidChange, then 
learns about the new
AVOutputDevice via -activeOutputDeviceDidChange:, both of which result in a 
call to
MediaSessionHelper::activeVideoRouteDidChange.

Resolved this in activeRoutesDidChange by eliding the call to 
activeVideoRouteDidChange if the
current output device is not yet an AirPlay device (or if m_playbackTarget is 
already configured
with the most recent active route). Resolved this in 
-activeOutputDeviceDidChange: by eliding the
call to activeVideoRouteDidChange if m_playbackTarget is already configured 
with the most recent
active route. This results in a single call to 
MediaSessionHelper::activeVideoRouteDidChange no
matter in which order activeRoutesDidChange and -activeOutputDeviceDidChange: 
are called.

Drive-by fix: removed an invalid assertion in 
MediaPlayerPrivateWirelessPlayback::setWirelessPlaybackTarget.

No new tests since this is device-specific behavior.

* Source/WebCore/platform/audio/ios/MediaSessionHelperIOS.mm:
(MediaSessionHelper::activeRoutesDidChange):
(MediaSessionHelperIOS::activeVideoRouteDidChange):
(-[WebMediaSessionHelper activeOutputDeviceDidChange:]):
* Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.cpp:
(WebCore::MediaPlayerPrivateWirelessPlayback::setWirelessPlaybackTarget):

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



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

Reply via email to