Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0b6f4e7703f54fb929fd7a17b7d5eb56c8325e7d
https://github.com/WebKit/WebKit/commit/0b6f4e7703f54fb929fd7a17b7d5eb56c8325e7d
Author: Andy Estes <[email protected]>
Date: 2026-02-18 (Wed, 18 Feb 2026)
Changed paths:
M LayoutTests/http/wpt/mediasession/setCaptureState-audio-category.html
A LayoutTests/media/audio-session-category-play-unmute-pause-expected.txt
A LayoutTests/media/audio-session-category-play-unmute-pause.html
M LayoutTests/platform/glib/TestExpectations
M Source/WebCore/platform/audio/AudioSession.cpp
M Source/WebCore/platform/audio/PlatformMediaSession.cpp
Log Message:
-----------
[iOS] AudioSession category incorrectly reset after pausing a media element
that started playing while muted
https://bugs.webkit.org/show_bug.cgi?id=308083
rdar://170586419
Reviewed by Youenn Fablet and Jer Noble.
PlatformMediaSession tracks whether its associated media element has played
audibly since the last
interruption. When it has, MediaSessionManager considers the session to be
potentially audible and
retains the MediaPlayback category on the shared audio session even if playback
is paused.
PlatformMediaSession set hasPlayedAudiblySinceLastInterruption to true when an
audible media
session starts playing, but did *not* set hasPlayedAudiblySinceLastInterruption
to true if a media
session becomes audible after it starts playing. If the user plays a muted
video, unmutes it, then
pauses it, MediaSessionManager would incorrectly change the shared audio
session's category to
Ambient.
Resolved this by calling
PlatformMediaSession::setHasPlayedAudiblySinceLastInterruption(true) in
PlatformMediaSession::canProduceAudioChanged() when m_state is Playing.
Test: media/audio-session-category-play-unmute-pause.html
* LayoutTests/http/wpt/mediasession/setCaptureState-audio-category.html:
* LayoutTests/media/audio-session-category-play-unmute-pause-expected.txt:
Added.
* LayoutTests/media/audio-session-category-play-unmute-pause.html: Added.
* LayoutTests/platform/glib/TestExpectations:
* Source/WebCore/platform/audio/AudioSession.cpp:
(WebCore::AudioSession::tryToSetActive):
* Source/WebCore/platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::setState):
(WebCore::PlatformMediaSession::canProduceAudioChanged):
Canonical link: https://commits.webkit.org/307778@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications