Re: [mediacapture-screen-share-extensions] Auto-pause for Captured Surface Switching (2nd edition) (#15)

Let me comment on the OP first to narrow down what is being proposed.

> 1. An event is added to the CaptureController that is emitted each time a user has switched to a new captured surface:
> ```js
> controller.addEventHandler('surfaceswitch', ...);
> ```

Do you mean [addEventListener](https://dom.spec.whatwg.org/#ref-for-dom-eventtarget-addeventlistener%E2%91%A2)? ([EventHandler](https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler)s are attributes the [guidelines recommend adding as well](https://w3ctag.github.io/design-principles/#always-add-event-handlers), `controller.onsurfaceswitch` in our case.)

> 2. Set enabled = false for all tracks associated with the capture.

This seems like a foot gun, and violates [Media Capture and Streams](https://w3c.github.io/mediacapture-main/getusermedia.html#track-enabled) which designates `muted` for UA control, and leaves `enabled` _"available to the application to control"_. 

Having the browser set this attribute can race with the application. Worst case, mistakenly inverted application logic might cause others to see the user when they shouldn't.

Other ideas we discussed (and I expressed support for), like [postSurfaceSwitchingHandler](https://docs.google.com/document/d/16CUOJeuXimNPi4kZHOS9rF-WhMuVvOqOg9P--Dvqi_w/edit#bookmark=id.3e5aj0t5ghqi) does not have this problem. In that model, no state is touched, the default behavior is to inject (which I prefer), with late JS action required to pause. Was it considered?

> 3. Update all tracks associated with the capture to the new surface.

Step 2 and 3 seem to invite confusion over whether a source or a track feature is being proposed.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-screen-share-extensions/issues/15#issuecomment-2432703197 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 23 October 2024 15:52:20 UTC