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

> How about this:
> 
> ```js
> const stream = await navigator.mediaDevices.getDisplayMedia();
> navigator.mediaDevices.addEventListener("focus", e => decide(stream) || e.preventDefault(), {once: true});
> ```
> 
> This would be the entire API surface. No need for exceptions. I'm open to bikeshedding the event name.

The use of `preventDefault` suggests that the default behavior would be specified as focus-captured-surface; is that right?

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


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

Received on Thursday, 7 October 2021 17:04:44 UTC