[英]Bug firefox 58 webcam webRTC
I have tried the following example of the web camera in firefox and chrome ( https://jsfiddle.net/codepo8/agaRe/4/ ). 我已经尝试过以下使用Firefox和chrome( https://jsfiddle.net/codepo8/agaRe/4/ )的网络摄像机示例。
function(stream) {
if (navigator.mozGetUserMedia) {
video.mozSrcObject = stream;
} else {
var vendorURL = window.URL || window.webkitURL;
video.src = vendorURL ? vendorURL.createObjectURL(stream) : stream;
}
video.play();
},
Today firefox has been updated to version 58 and the example has stopped working. 今天,firefox已更新至版本58,并且该示例已停止工作。
However, in chrome it is still working. 但是,在chrome中它仍在工作。
Could you help me? 你可以帮帮我吗?
The non-standard mozSrcObject
was removed in Firefox 58 in favor of srcObject
. 非标准的
mozSrcObject
在Firefox 58中被删除 ,取而代之的是srcObject
。
Also, other lines in this function are wrong. 另外,此功能中的其他行是错误的。 See this other answer .
看到其他答案 。 All you need these days are:
这些天您需要做的是:
function(stream) {
video.srcObject = stream;
video.play();
},
This works in all browsers that support WebRTC. 在所有支持WebRTC的浏览器中都可以使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.