Re: [mediacapture-main] getUserMedia "hanging" indefinitely (#846)

> since the other errors (`NotFoundError`, `OverconstrainedError`) are all more informative

That might be a problem. Say a privacy-aware browser does not want to reject with those exceptions, it cannot really do that. Adding a reject step before those checks seem useful: if user denies camera access forever to a given website, user might not want to let the website that there is a camera or not.

Similarly, we are doing the permission policy checks after checking devices which seems wrong.
I'll file a separate issue for that.

> it might try to determine that by checking the browser name+version against a list of known expiration times

If we keep reject once focused, the application does not have to do browser specific checks.
It just has to wait for focus to happen, wait for promise to either be rejected a very short amount of time after it is back to focus. This allows to determine at the time the application should actually call getUserMedia whether it should or not.
As an example, say user focuses the page and clicks very quickly on the 'capture'  button.
In that case, maybe the click event handler could be called before the getUserMedia promise is resolved.
This seems like an edge case that browsers could probably make sure to implement well without changing the spec ( a user click would first trigger focus, the promise would get rejected, then user would click on the button which would call the button event handler).


-- 
GitHub Notification of comment by youennf
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/846#issuecomment-1007968559 using your GitHub account


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

Received on Saturday, 8 January 2022 11:45:07 UTC