Re: [mediacapture-screen-share] A CaptureController object for getDisplayMedia() (#230)

> AIUI, current proposal is close to 2 but with the constraint that focus() is called only once around the time getDisplayMedia is called/resolved.

FWIW I disagree with this characterization, as it associates the OP proposal with features that aren't being proposed (straw man). My comparison to user activation was merely meant to suggest our concern over sites missing a timeout seems overblown, because the task of focusing a window is inherently racy with end users anyway who may be focusing windows themselves if they become impatient. E.g. as a user if my CPU is so busy it takes 2 seconds for a site to request focus, then chances are I'll have clicked somewhere else already which might cause focus to never happen. I question letting such edge cases impact API design.

> 3. If CaptureController.setFocusBehavior() is not called, focus behavior is not specified. 

Would this unspecified behavior be identical to point 1? An advantage of leaving the default focus behavior unchanged perhaps is that if the controller grows more orthogonal features in the future (e.g. send capture actions), people might add the controller to use those features only and be surprised by the inadvertent change in focus behavior. So maybe that part is better? OTOH in the send capture handle case users probably DON'T want to focus, so it's hard to say which is better.

> 5. CaptureController.setFocusBehavior() raises an exception if called from a microtask other than the one getDisplayMedia() resolved on.

This seems like a rehash of #190 with all its microtask problems I raised there. Do we really want to go back there?

A microtask-sensitive promise-based API sounds terrible and wouldn't even work with `Promise.race()`. Wouldn't that also preclude use of Capture Handle to answer the focus decision?

If we go that way, then a callback like @youennf suggested might work. But even that wouldn't stop JS from using XHR to do networking...

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


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

Received on Friday, 2 September 2022 21:38:15 UTC