From 772f0ec45ef0207055ac9cbf9a1a464dde3eaab4 Mon Sep 17 00:00:00 2001 From: Youenn Fablet Date: Wed, 10 Jan 2024 17:00:37 +0100 Subject: [PATCH] Make setMicrophoneActive and setCameraActive return promises Define steps for each of these methods. Mention the possibility to mute/unmute tracks based on setMicrophoneActive/setCameraActive calls. Mention the possibility for the user agent to deny the mutation of capture states via setMicrophoneActive/setCameraActive calls. --- index.bs | 105 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 95 insertions(+), 10 deletions(-) diff --git a/index.bs b/index.bs index fb9834a..df20787 100644 --- a/index.bs +++ b/index.bs @@ -85,6 +85,7 @@ urlPrefix: https://html.spec.whatwg.org/multipage/dom.html; spec: dom text: permissions policy; url:#concept-document-permissions-policy urlPrefix: https://www.w3.org/TR/mediacapture-streams/; spec: mediacapture-main type: dfn + text: MediaStreamTrack; url:#mediastreamtrack text: MediaStreamTrack muted state; url:#track-muted text: set MediaStreamTrack muted state; url:#set-track-muted @@ -786,9 +787,9 @@ interface MediaSession { undefined setPositionState(optional MediaPositionState state = {}); - undefined setMicrophoneActive(boolean active); + Promise<undefined> setMicrophoneActive(boolean active); - undefined setCameraActive(boolean active); + Promise<undefined> setCameraActive(boolean active); }; @@ -922,14 +923,98 @@ interface MediaSession {

- The setMicrophoneActive(active) and - setCameraActive(active) methods indicate to - the user agent whether the microphone and camera are currently considered by - the page to be active (e.g. if the microphone is considered "muted" by the - page since it is no longer sending audio through to a call, then the page can - invoke setMicrophoneActive(false)). - It is RECOMMENDED that the user agent respect the microphone and camera - states indicated by the page in this UI. + The setMicrophoneActive(active) method + indicates to the user agent the microphone state desired by the page (e.g. if + the microphone is considered "muted" by the page since it is no longer sending + audio through a call, the page can invoke + setMicrophoneActive(false)). When invoked, it MUST perform the + following steps: +

+

+

+ Similarly, the setCameraActive(active) + method indicates to the user agent the camera state desired by the page. When + invoked, it MUST perform the following steps: +

+

+

+ When the update capture state algorithm is invoked with + document, active and captureKind, the user + agent MUST perform the following steps: +

+

+

+ Both the setMicrophoneActive(active) and setCameraActive(active) + methods can reject based on user agent specific heuristics. This might in + particular happen when the web page asks to activate (aka unmute) microphone + or camera. The user agent could decide to require [=transient activation=] in + that case. It might also require user input through a prompt to make the + actual decision.