Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 06bdf1c6610d9bedd2bf2a677dbbf553af541ff2
      
https://github.com/WebKit/WebKit/commit/06bdf1c6610d9bedd2bf2a677dbbf553af541ff2
  Author: Andy Estes <[email protected]>
  Date:   2026-03-04 (Wed, 04 Mar 2026)

  Changed paths:
    M Source/WebCore/html/MediaElementSession.cpp
    M Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.cpp
    M Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.h

  Log Message:
  -----------
  REGRESSION(307567@main): many tests in imported/w3c/web-platform-tests/webvtt 
time out
https://bugs.webkit.org/show_bug.cgi?id=309136
rdar://171659558

Reviewed by Eric Carlson.

When MediaPlayer::loadWithNextMediaEngine is called and there is no next "best" 
media engine, it
attempts to load with the next media engine in installedMediaEngines() 
regardless of whether it
claims to support the current load parameters. This means that 
MediaPlayerPrivateWirelessPlayback
may be asked to load during local playback. When 
MediaPlayerPrivateWirelessPlayback::load is called
it returns early since it has not yet been told about a wireless playback 
target, and since it will
*never* be told about such a target the engine's network and ready states will 
never advance and
the MediaPlayer will be stuck using a non-viable engine for local playback.

Resolved this by changing 
MediaPlayerPrivateWirelessPlayback::m_shouldPlayToTarget from a boolean
to a tri-state enumeration. It starts out in an Unknown state, and later, if
setShouldPlayToPlaybackTarget() is called with false then it advances its 
network state to
FormatError so that MediaPlayer knows to load the next media engine. Otherwise 
it calls
updateURLIfNeeded() as it did before.

MediaElementSession::mediaEngineUpdated() was also changed to unconditionally 
call
setShouldPlayToPlaybackTarget() with the value of m_shouldPlayToPlaybackTarget 
so that the new
media engine is given a chance to advance to an error state if it doesn't 
support the current
playback target.

Drive-by fix: Changed MediaPlayerPrivateWirelessPlayback to override the load 
method that takes a
URL and LoadOptions to avoid an unnecessary URL->String->URL round-trip 
conversation.

Covered by existing tests.

* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::mediaEngineUpdated):
* Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.cpp:
(WebCore::MediaPlayerPrivateWirelessPlayback::load):
(WebCore::MediaPlayerPrivateWirelessPlayback::isCurrentPlaybackTargetWireless 
const):
(WebCore::MediaPlayerPrivateWirelessPlayback::setShouldPlayToPlaybackTarget):
(WebCore::MediaPlayerPrivateWirelessPlayback::updateURLIfNeeded):
(WebCore::MediaPlayerPrivateWirelessPlayback::engineDescription const):
* Source/WebCore/platform/graphics/MediaPlayerPrivateWirelessPlayback.h:

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



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

Reply via email to