[webkit-changes] [WebKit/WebKit] 94e09d: [Mac] Unable to unpause video using "play/pause" k...
Jer Noble
noreply at github.com
Mon Jan 13 10:10:54 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 94e09d11c6cdfb523a550b6a91388d8b30100cfc
https://github.com/WebKit/WebKit/commit/94e09d11c6cdfb523a550b6a91388d8b30100cfc
Author: Jer Noble <jer.noble at apple.com>
Date: 2025-01-13 (Mon, 13 Jan 2025)
Changed paths:
A LayoutTests/media/remote-control-command-paused-with-webaudio-expected.txt
A LayoutTests/media/remote-control-command-paused-with-webaudio.html
M Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp
M Source/WebCore/platform/audio/PlatformMediaSessionManager.h
Log Message:
-----------
[Mac] Unable to unpause video using "play/pause" keyboard key on Chess.com
https://bugs.webkit.org/show_bug.cgi?id=285787
rdar://138120620
Reviewed by Jean-Yves Avenard.
When a media element moves from a playing to paused state, PlatformMediaSessionManager
re-orders its list of active sessions. If there are any other playing sessions, the newly
paused session is moved to the end of the list of active sessions.
Separately, when a remote control command is received, that command is dispatched to the
first session in the list of active sessions. If that session does not support remote control
commands, the command is dropped.
On Chess.com, there are >16 active sessions when a video is playing. Many are WebAudio sessions,
but some are HTMLAudioElement sessions used for sound effects. After pausing the video on the
page, that video's session is moved to the end of the list of active sessions, below all the
playing WebAudio sessions as well as the paused HTMLAudioElement sessions. When a remote control
command is subsequently received, it's dispatched to the WebAudio session, which drops it.
This fix has two parts:
- When a session is paused, it is moved in the session list just after the last playing session,
rather than to the end of the list.
- When a remote control command is received, it's sent to the first session in the list of
active sessions which supports remote control commands.
* LayoutTests/media/remote-control-command-paused-with-webaudio-expected.txt: Added.
* LayoutTests/media/remote-control-command-paused-with-webaudio.html: Added.
* Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
(WebCore::PlatformMediaSessionManager::processDidReceiveRemoteControlCommand):
(WebCore::PlatformMediaSessionManager::firstSessionMatching const):
* Source/WebCore/platform/audio/PlatformMediaSessionManager.h:
Canonical link: https://commits.webkit.org/288808@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list