Re: [mediacapture-screen-share] Conditional Focus (When Display-Capture Starts) (#190)

> `...navigator.mediaDevices.displayMediaFocusMode = "no-focus";`

I don't think this is going to "play nice" if the document is engaged in multiple concurrent captures.

> it affects subsequent calls, but if you set it immediately, it affects what just resolved as well

I don't think that's [simple](https://w3ctag.github.io/design-principles/#simplicity), because the association between what gets captured and what gets focused is not there, and concurrent captures become clouded by questions of timing.

> A user's focus is a global property, so a per-track API [simply](https://w3ctag.github.io/design-principles/#simplicity) isn't necessary, and we can avoid the subclassing headache.

How is `navigator.mediaDevices.someFocusApi` different than `FMST.focus()` with respect to "globality"?
`FMST.focus()` allows feature discovery; it'd be impossible for an application to attempt to call it on a non-supporting track. So that's a benefit of this approach. What benefits would the other approach confer?

> What matters is the amount of code that runs up to the point of invoking the focus method.

One does not need a lot of code to place a "Click here to win a million dollars" button and then guess how long to wait before switching focus to the other tab and getting the user to click something there. Moreover, if you use tasks rather than microtasks, I think it's easier to wait for an on-over event, making guesses about when the click is coming easier.

I don't think we can measure and base a decision off of how much code runs, regardless of whether the window-of-opportunity is closed by a task or a microtask. Either could run an arbitrary amount of code. The user's reaction time, though...

> It also seems biased against apps that use promises.

Some of my best friends are apps that use Promises. I have found them to be able to switching between using Promises and doing things synchronously, as the need arises.


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


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

Received on Thursday, 23 September 2021 13:37:19 UTC