Re: Improve error message when browser denies access to getUserMedia()

On Fri, Jul 26, 2013 at 1:51 AM, cowwoc <cowwoc@bbs.darktech.org> wrote:
>
>     I think there is a misunderstanding of the issue. I am asking to
> differentiate between:
>
> * Access denied by the user (whether directly or by way of a saved preference)

Looking at http://dev.w3.org/2011/webrtc/editor/getusermedia.html#idl-def-NavigatorUserMediaError,
that's the error message PERMISSION_DENIED

> * Access denied by the browser

and this would be CONSTRAINT_NOT_SATISFIED - or wouldn't it?


>     The former is recoverable. The latter is fatal (likely a programming
> bug).
>
>     I am *not* asking to differentiate between a user denying access
> directly versus denying access by way of a saved preference.

PERMISSION_DENIED_USER and PERMISSION_DENIED_BROWSER don't seem the
right choice of names then.

Maybe you can specify more clearly what case you'd like flagged that
is different from CONSTRAINT_NOT_SATISFIED ?


Is it e.g. something like DEVICE_NOT_AVAILABLE ? Then I could imagine
the browser going:

1. Did the user (at some stage) disallow me to access the device?
Yes: flag PERMISSION_DENIED error
     -> JS can react and bring up informative dialog
    (I'd actually prefer that to the browser bringing up the dialog -
maybe there should be a way to ask the browser not to bring up the
dialog?)
No: proceed

2. Can I get to the device?
No: flag DEVICE_NOT_AVAILABLE error
    -> JS can react and bring up a dialog telling the user to check
the camera connection
Yes: proceed

3. Can I get the stream from the device with the given constraints?
No: flag CONSTRAINT_NOT_SATISFIED error
    -> JS can react and read what constraints the device supports (do
we have such an API??) or at least try a different constraint set
Yes: proceed


Cheers,
Silvia.

Received on Thursday, 25 July 2013 22:18:32 UTC