[mediacapture-main] Clarify when the application can retry getUserMedia after it returns "InvalidStateError" due to the window not being in focus (#763)

q-alex-zhao has just created a new issue for https://github.com/w3c/mediacapture-main:

== Clarify when the application can retry getUserMedia after it returns "InvalidStateError" due to the window not being in focus ==
The [media capture spec](https://w3c.github.io/mediacapture-main/getusermedia.html#dom-mediadevices-getusermedia) says:

> If the relevant settings object's responsible document is NOT fully active, return a promise rejected with a DOMException object whose name attribute has the value "InvalidStateError".

From whatwg/html#6211, the internal logic for the window being visible and focused would not be exposed to the application. So I think the application should not depend on `document.hasFocus()` returning true to assume it's good to call `getUserMedia` to begin with; it should always just call `getUserMedia` and inspect the result.

My naive question is when the application may retry `getUserMedia` after receiving this "InvalidStateError", e.g. for showing a preview video before joining a meeting. Just periodically?

Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/763 using your GitHub account


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

Received on Wednesday, 13 January 2021 00:02:24 UTC