New issue
Advanced search Search tips

Issue 598036 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

navigator.getUserMedia requires three parameters, which seems different than other API calls where error handler is optional

Project Member Reported by benhill@google.com, Mar 25 2016

Issue description

Chrome Version       : 49.0.2623.87

Video issue, Audio issue, both, neither? API issue.

When calling most javascript APIs, the last parameter of the error handler is usually optional.  However, calling 

navigator.webkitGetUserMedia({}, function(){});

results in

"Uncaught TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': 3 arguments required, but only 2 present."

Which seems different than the norm.  Why is the error handler required for this function?  If this is the new normal, please close as WAI.

PS: please also support promises. :)


 
Components: -Internals>Media Blink>GetUserMedia
Cc: guidou@chromium.org hta@chromium.org jansson@chromium.org
Status: WontFix (was: Unconfirmed)
> If this is the new normal, please close as WAI.
Per https://w3c.github.io/mediacapture-main/getusermedia.html#methods-4, the errorCallback in the latest spec is no longer optional.

> PS: please also support promises.
Please try out the latest (Canary) version of Chrome and file bugs and/or feature requests. From reading bugs like  bug 582914  and  bug 582920 , I think some amount of promise support is available in Canary versions of Chrome, but I don't have a sense for how much support is available, or how much more work is left.

Comment 3 by benhill@google.com, Mar 30 2016

I agree with you that the errorCallback is no longer optional in the spec.
I think that is strange, and not promise-friendly, and doesn't seem to match all the history of optional error callbacks.  

I don't know if what I think matters: the spec may be written in stone.  Or, this may be the way things are going in the future.  Either way, I vote +1 for consistency.

Comment 4 by hta@chromium.org, Mar 30 2016

Omitting the error callback means that if something goes wrong, nothing will happen. Especially when we move to supporting promises, where errors can't be thrown, having the user supply the error callback is essential to correctly functioning programs.

We have tried to be consistent; the error callback is (as far as possible) mandatory for all interfaces that support one.

(The promise support is waiting for fuller standards-compliant constraints support.)


Comment 5 by benhill@google.com, Mar 31 2016

Cool, thanks for the clarification!

Sign in to add a comment