From f90a2793ff7c5149a5580542cd36ae4ea23358b5 Mon Sep 17 00:00:00 2001
From: Youenn Fablet
- A user agent MAY expose microphone and camera state to web pages via - {{MediaStreamTrack}}'s {{MediaStreamTrack/muted}} attribute in addition - to {{MediaSessionAction/togglemicrophone}} or - {{MediaSessionAction/togglecamera}} [=media session action=]. In that + A user agent MAY expose microphone, camera and screenshare state to web pages + via {{MediaStreamTrack}}'s {{MediaStreamTrack/muted}} attribute in addition + to {{MediaSessionAction/togglemicrophone}}, {{MediaSessionAction/togglecamera}} + or {{MediaSessionAction/togglescreenshare}} [=media session action=]. In that case, the user agent MUST execute the corresponding {{MediaSessionActionHandler}} before running, as different tasks, the steps defined to [$set a track's muted state$]. @@ -707,6 +712,7 @@ enum MediaSessionAction { "seekto", "togglemicrophone", "togglecamera", + "togglescreenshare", "hangup", "previousslide", "nextslide", @@ -728,6 +734,8 @@ interface MediaSession { Promise<undefined> setMicrophoneActive(boolean active); Promise<undefined> setCameraActive(boolean active); + + Promise<undefined> setScreenshareActive(boolean active); }; @@ -899,6 +907,24 @@ interface MediaSession {
++ Similarly, the setScreenshareActive(active) + method indicates to the user agent the screenshare 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 @@ -980,10 +1006,11 @@ interface MediaSession {
- 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 + The setMicrophoneActive(active), setCameraActive(active) + and setScreenshareActive(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, + camera or screenshare. 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.