navigator.getUserMedia requires three parameters, which seems different than other API calls where error handler is optional |
||
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. :)
,
Mar 30 2016
> 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.
,
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.
,
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.)
,
Mar 31 2016
Cool, thanks for the clarification! |
||
►
Sign in to add a comment |
||
Comment 1 by yini...@chromium.org
, Mar 29 2016