diff --git a/index.bs b/index.bs index fb9834a..118cb0a 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,125 @@ 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 capture state desired by the page
+ (e.g. if the microphone is considered "inactive" 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 capture state desired by the page. + When invoked, it MUST perform the following steps: +
+ The update capture state algorithm, when invoked with + document, active and captureKind, + MUST perform the following steps: +
true
and document's
+ [=Document/visibility state=] is not "visible", the user agent MAY return
+ [=a promise rejected with=] InvalidStateError.
+ true
if the user agent
+ implements a policy of pausing all input sources of type
+ captureKind in response to UI and false
+ otherwise.
+ true
, run the following substeps:
+ false
if the user
+ agent is currently [=pausing all input sources=] of type captureKind
+ and true
otherwise.
+ undefined
and abort these steps.
+ true
, the user agent MAY wait to
+ proceed, for instance to prompt the user.
+ undefined
.true
, run the following substeps:
+ true
if active is
+ false
and false
otherwise.+ 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.