Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d642eeea6966a9805e01d25cfe44c2478a412dc5
      
https://github.com/WebKit/WebKit/commit/d642eeea6966a9805e01d25cfe44c2478a412dc5
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2026-08-16 (Sun, 16 Aug 2026)

  Changed paths:
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/platform/audio/MediaSessionManagerInterface.cpp

  Log Message:
  -----------
  REGRESSION(19099@main): [macOS iOS] 
media/video-multiple-concurrent-playback.html is flaky failure
https://bugs.webkit.org/show_bug.cgi?id=321819
rdar://184960798

Reviewed by Eric Carlson.

The test plays four videos, calling play() on the next one from the previous
element's 'playing' handler. videos[2] and videos[3] can't play concurrently, so
videos[2] should end up paused and videos[3] playing. Sometimes both were 
paused.

Since 319099@main the 'playing' event no longer waits for the session 
admission, so
videos[3].play() runs while videos[2]'s admission is still outstanding: 
videos[2] had
to activate the audio session (the first two videos have no audio) and 
completes from
the task whenSettled() queued, while videos[3]'s playability is known and 
resolves
immediately. videos[3] pauses videos[2] there, and sessionWillEndPlayback() 
moves videos[2]
ahead of videos[3], which isn't Playing yet; currentSession() is the front of 
the
list, so videos[2] becomes current and pauses videos[3] when its own admission 
task
runs.

sessionWillEndPlayback() now counts a session with preparingToPlay() as 
playing, as
enforceConcurrentPlaybackRestriction() already does, so the pausing session 
moves to
the end of the list and the session that evicted it stays current.

This is a workaround. Treating the front of the session list as "the session 
that
claimed playback last" is fragile while two functions reorder that list and the
claiming session isn't Playing yet. Tracking the session whose admission 
started last
is left for a follow-up.

* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/platform/audio/MediaSessionManagerInterface.cpp:
(WebCore::MediaSessionManagerInterface::sessionWillEndPlayback): Treat a 
session whose
admission is in flight as playing.

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



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

Reply via email to