[webkit-changes] [WebKit/WebKit] 76e52d: [WebXR] Allow audio and media sessions to continue...
Ada Chan
noreply at github.com
Thu Feb 15 10:21:17 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 76e52d168312e91a83bd2f9db3535f6921b3cd87
https://github.com/WebKit/WebKit/commit/76e52d168312e91a83bd2f9db3535f6921b3cd87
Author: Ada Chan <adachan at apple.com>
Date: 2024-02-15 (Thu, 15 Feb 2024)
Changed paths:
M Source/WebCore/Modules/webaudio/AudioContext.cpp
M Source/WebCore/Modules/webxr/WebXRSystem.cpp
M Source/WebCore/Modules/webxr/WebXRSystem.h
M Source/WebCore/html/HTMLMediaElement.cpp
M Source/WebCore/page/Page.cpp
M Source/WebCore/page/Page.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
Log Message:
-----------
[WebXR] Allow audio and media sessions to continue uninterrupted when starting immersive WebXR sessions
https://bugs.webkit.org/show_bug.cgi?id=269332
rdar://102391109
Reviewed by Eric Carlson.
The original Safari window gets backgrounded when we start an immersive WebXR
session. We need to allow audio/media to continue playback when we get a
backgrounding notification for this scenario, similar to how we handle this
for picture-in-picture.
* Source/WebCore/Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::shouldOverrideBackgroundPlaybackRestriction const):
Return true if the page has an active WebXR immersive session.
* Source/WebCore/Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::hasActiveImmersiveSession const):
* Source/WebCore/Modules/webxr/WebXRSystem.h:
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
Return true if the page has an active WebXR immersive session.
* Source/WebCore/page/Page.cpp:
(WebCore::Page::hasActiveImmersiveSession const):
Walk the frame tree and return true if any frame's window has an active
WebXR immersive session.
* Source/WebCore/page/Page.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState):
Similar to picture-in-picture, skip freezing the layer tree state if
the window gets backgrounded due to an active immersive session.
Canonical link: https://commits.webkit.org/274742@main
More information about the webkit-changes
mailing list