Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: df859556a4dc74c46480974eaa615c81ac2382b8
https://github.com/WebKit/WebKit/commit/df859556a4dc74c46480974eaa615c81ac2382b8
Author: Youenn Fablet <[email protected]>
Date: 2024-09-23 (Mon, 23 Sep 2024)
Changed paths:
M Source/WebCore/page/MediaProducer.h
M Source/WebKit/UIProcess/API/C/WKPage.cpp
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm
Log Message:
-----------
setCameraActive should not unmute microphone if UA previously muted both
camera and microphone
rdar://136221456
https://bugs.webkit.org/show_bug.cgi?id=279889
Reviewed by Eric Carlson.
When trying to unmute capture via setCameraActive/setMicrophoneActive a capture
that was muted by the UA,
we would unmute both microphone and camera at the same time.
This is probably not great for the user.
For that reason, we now store in WebPageProxy whether the web page would like
to have capture muted (for each capture type).
This new state, called m_mutedCaptureKindsDesiredByWebApp, can be changed in
two ways:
- this state can be set to muted whenever UA decides so (WKWebView user).
- this state can be set to muted/unmuted via
setCameraActive/setMicrophoneActive if successful.
The muted state sent to WebPage in WebPageProxy::setMuted is updated according
m_mutedCaptureKindsDesiredByWebApp.
This allows to not restart microphone capture if the web app only asked to
restart camera capture.
Note that m_mutedCaptureKindsDesiredByWebApp is only used to further mute
capture (and not unmute capture).
Covered by added and updated API tests.
* Source/WebCore/page/MediaProducer.h:
* Source/WebKit/UIProcess/API/C/WKPage.cpp:
(WKPageSetMuted):
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setMicrophoneCaptureState:completionHandler:]):
(-[WKWebView setCameraCaptureState:completionHandler:]):
(-[WKWebView _setPageMuted:]):
(-[WKWebView _setDisplayCaptureState:completionHandler:]):
(-[WKWebView _setSystemAudioCaptureState:completionHandler:]):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::applyWebAppDesiredMutedKinds):
(WebKit::updateMutedCaptureKindsDesiredByWebApp):
(WebKit::WebPageProxy::setMuted):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::willStartCapture):
(WebKit::WebPageProxy::validateCaptureStateUpdate):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
(TestWebKitAPI::(WebKit2, ToggleCameraCaptureWhenRestarting)):
(TestWebKitAPI::(WebKit2, ToggleMicrophoneCaptureWhenRestarting)):
(TestWebKitAPI::(WebKit2, ToggleCaptureWhenRestarting)): Deleted.
Canonical link: https://commits.webkit.org/284069@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes