Re: [mediacapture-screen-share-extensions] Auto-pause capture when user switches captured content (#4)

> What enforces that the website can't keep both the old live injected track and the live new track? We need to specify this implicit action at a distance.

I do not see any implicit action at a distance, the website can keep both
Is there an issue with that?

> If this means there's one place where you decide what happens with the old tracks

In my mind, the default behavior (whether setting the callback or not) is that no track is being stopped by UA, the web page can deal with it by itself.

We can enrich the callback to make the UA stop the previous tracks, for instance:
* `captureController.setDisplaySurfaceChangeCallback(stream => { ... }, { mode: 'stop-previous-tracks' })`
*  `captureController.setDisplaySurfaceChangeCallback(stream => { ...; return 'stop-previous-tracks'; })`
*  `captureController.setDisplaySurfaceChangeCallback(stream => { ...; captureController.stopPreviousTracks();... })`
*  `captureController.setDisplaySurfaceChangeCallback(async stream => { await...; captureController.stopPreviousTracks();... });`

It is a bit less straightforward to extend things with an event. And again, it is not really compelling to have several event listeners sharing the responsibility to stop the old tracks (or the new tracks).

Also, I could see a UA tailoring its UI based on the callback being registered (not showing the sharing audio check box if no audio was shared before the surface switching for instance).
This is sort of similar to MediaSession going with callbacks as action handlers.

> Can we make it a settable attribute at least?

Ah, good point, I guess this would disallow option 1 above.

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


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

Received on Thursday, 3 October 2024 03:20:03 UTC