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

> Only the first option produces consistent results (and raises a clear exception when used incorrectly).

Of the three listed, which is a false choice. We don't need to subclass anything to throw. See below:

> I would not object to adding a global attribute that reads (and potentially writes?) the default behavior ...

So you'd introduce an attribute *and* a method?

Contrast:
```js
navigator.mediaDevices.defaultFocusPolicy = "focus-change";
const stream = await navigator.mediaDevices.getDisplayMedia();
await someOtherPromisesThatResolvesMuchLater;
navigator.mediaDevices.focus("no-focus-change"); // throws InvalidStateError, focus already happened
```
vs.
```js
navigator.mediaDevices.focusPolicy = "focus-change";
const stream = await navigator.mediaDevices.getDisplayMedia();
await someOtherPromisesThatResolvesMuchLater;
navigator.mediaDevices.focusPolicy = "no-focus-change"; // Doesn't throw, focus already happened
```


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


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

Received on Monday, 27 September 2021 17:29:05 UTC