[webkit-changes] [WebKit/WebKit] b39392: REGRESSION (iOS 17.2) Script can not always start ...
Eric Carlson
noreply at github.com
Sat Feb 24 10:55:53 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b39392ba956ea7216e38fc3ae39689556a8a524d
https://github.com/WebKit/WebKit/commit/b39392ba956ea7216e38fc3ae39689556a8a524d
Author: Eric Carlson <eric.carlson at apple.com>
Date: 2024-02-24 (Sat, 24 Feb 2024)
Changed paths:
M LayoutTests/media/audio-background-playback-playlist-expected.txt
M LayoutTests/media/audio-background-playback-playlist.html
M Source/WebCore/html/MediaElementSession.cpp
M Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp
M Source/WebCore/platform/audio/cocoa/AudioSessionCocoa.mm
M Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/WebProcessPool.cpp
Log Message:
-----------
REGRESSION (iOS 17.2) Script can not always start audio playback in the background
https://bugs.webkit.org/show_bug.cgi?id=269938
rdar://121268089
Reviewed by Andy Estes.
Don't deactivate the media activity during the 10 second foreground activity "grace period"
so script has a chance to start playback, e.g. for a playlist, when the application is in
the background.
* LayoutTests/media/audio-background-playback-playlist-expected.txt:
* LayoutTests/media/audio-background-playback-playlist.html: Update test to wait for the
'error' event before checking NowPlaying eligibility.
* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const): Don't say an element that
has a source and is not in an error state is ineligible to activate NowPlaying if we are
already registered as the NowPlaying app.
* Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::maybeActivateAudioSession): Log when we return
`false` because an active audio session is not needed to make future debugging easier.
* Source/WebCore/platform/audio/cocoa/AudioSessionCocoa.mm:
(WebCore::AudioSessionCocoa::tryToSetActiveInternal): Log when activating or deactivating
the audio session fails.
* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::setMediaCapability): log when the media capability is cleared.
(WebKit::WebPageProxy::shouldDeactivateMediaCapability const): Return false if there is
valid audio activity so we wait to deactivate the capability while the foreground
activity timer is active.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateThrottleState): Log when starting or stopping the foreground
activity "grace period" timer.
(WebKit::WebPageProxy::clearAudibleActivity): Fix logging. Call `updateMediaCapability`.
(WebKit::WebPageProxy::hasValidAudibleActivity const):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearAudibleActivity): Add logging.
(WebKit::WebProcessPool::updateAudibleMediaAssertions): Clarify log message.
Canonical link: https://commits.webkit.org/275285@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