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

The switch and injection models are roughly equivalent to me for applications that are ok reacting synchronously to a switch change.

When the reaction is asynchronous (say applying region capture), I am not sure one of the presented model is more suited (VideoTrackGenerator to the rescue maybe).

Wrt option 2 and 3, they are not mutually exclusive with the callback approach:
1. No need for the previous option 3 optimization: no callback => new tracks are stopped/never existed.
2. We start simple (`captureController.processSourceSwitch(callback)`)  and extend the API when we are ready.

Isn't option2 somehow equivalent to one of these option 2 extensions ?
1. `captureController.processSourceSwitch(callback, { mode: 'stop-previous-tracks' })`
2. `captureController.processSourceSwitch(stream => { ...; return 'stop-previous-tracks'; })` // synchronous decision and video frames flowing
3. `captureController.processSourceSwitch(async stream => { await...; return 'stop-previous-tracks'; })` // asynchronous decision and video frames flowing

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


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

Received on Wednesday, 25 September 2024 14:04:42 UTC