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

The `postSurfaceSwitchingHandler` proposal as I understand it:

One or more handlers can be added to the `CaptureController`:
```
async function handler() {
  controller.addPostSurfaceSwitchingHandler(handler)
  // Return a promise that is resolved when setup has finished.
};
controller.addPostSurfaceSwitchingHandler(handler);
```
If there is at least one handler registered, a surface switch goes through the following steps:
1. Stop emitting frames on all tracks associated with the capture.
1. Update all tracks associated with the capture to the new surface.
1. Remove all handlers from the list of handlers, and keep them in a temporary list.
1. Call the removed handlers and collect the returned promises.
1. Resume emitting frames on all tracks associated with the capture when `Promise.all(allCallbackResults)` has been resolved.

@jan-ivar, 
Does this agree with your idea of how the `postSurfaceSwitchingHandler` should work?

@youennf, 
1. What do you think about this proposal?
1. If we instead pursue the `onconfigurationchange` approach, how do you envision that the application would know that a surface-switch has occurred and not some other change?


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


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

Received on Thursday, 24 October 2024 11:31:22 UTC