问题描述
我想使用的方法getUserMedia(),但在那一刻我尝试调用它,控制台返回我的错误
I'm trying to use the method getUserMedia() but in the moment I try to call it, the console returns me that error
对象#没有方法'getUserMedia'。
"Object # has no method 'getUserMedia'"
您已经得到的为什么会这样想?
Have you got any idea of why is this happening?
我使用的是最新版本的Chrome
I'm using the latest version of Chrome
推荐答案
Chrome浏览器目前的版本不支持pfixed未$ P $ navigator.getUserMedia
。您需要检查该功能是否支持,并尝试prefixed替代品,如 navigator.webkitGetUserMedia
,以及
Current versions of Chrome do not support unprefixed navigator.getUserMedia
. You will need to check whether this feature is supported and try prefixed alternatives, such as navigator.webkitGetUserMedia
, as well.
有关详细信息,请参阅样本code。在 -
For details, see the sample code at https://developer.mozilla.org/en-US/docs/WebRTC/navigator.getUserMedia --
navigator.getMedia = ( navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
navigator.msGetUserMedia);
navigator.getMedia (constraints, success, error);
和记住 navigator.getMedia
可能的还是的被浏览器是否支持这些方法不明确的。这仍然是一个非常新的功能,并没有普遍可用的。
And keep in mind that navigator.getMedia
may still be undefined if the browser supports none of these methods. It's still a very new feature, and is not universally available.
这篇关于对象#<&导航器GT;没有方法'getUserMedia“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!