突然之间,在PermissionDeniedError和getUserMedia上出现了RTCMultiConnection错误,而一切都运行得很好。而且不仅仅是在Chrome。
考虑到API是实验性的,在不断变化的限制和浏览器兼容性的情况下,并且知道这个问题已经再次被问到,而没有看到任何可用的答案,我冒着风险去问。
我不认为错误与
getUserMedia() no longer works on insecure origins. 上面的问题出现在Opera 34.0和Chrome 47中,而Firefox 40运行良好。
这不是应用程序的缺陷或相机兼容性,因为我也在https://jsfiddle.net/zar6fg60/上测试过,在台式机和笔记本电脑中都有相同的错误。
控制台日志错误
name PermissionDeniedErrorconnection.onMediaError @ RTCMultiConnection.js:5592mediaConfig.onerror @ RTCMultiConnection.js:594(anonymous function) @ RTCMultiConnection.js:3931getUserMedia @ RTCMultiConnection.js:3930_captureUserMedia @ RTCMultiConnection.js:678captureUserMedia @ RTCMultiConnection.js:503(anonymous function) @ RTCMultiConnection.js:118initRTCMultiSession @ RTCMultiConnection.js:228connection.open @ RTCMultiConnection.js:108_.onclick @ inter_stream.js:240
RTCMultiConnection.js:5593 constraintName {
"audio": {
"mandatory": {},
"optional": [
{
"chromeRenderToAssociatedSink": true
}
]
},
"video": true
}connection.onMediaError @ RTCMultiConnection.js:5593mediaConfig.onerror @ RTCMultiConnection.js:594(anonymous function) @ RTCMultiConnection.js:3931getUserMedia @ RTCMultiConnection.js:3930_captureUserMedia @ RTCMultiConnection.js:678captureUserMedia @ RTCMultiConnection.js:503(anonymous function) @ RTCMultiConnection.js:118initRTCMultiSession @ RTCMultiConnection.js:228connection.open @ RTCMultiConnection.js:108_.onclick @ inter_stream.js:240
RTCMultiConnection.js:5594 message Either:
Media resolutions are not permitted.
Another application is using same media device.
Media device is not attached or drivers not installed.
You denied access once and it is still denied.
Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).connection.onMediaError @ RTCMultiConnection.js:5594mediaConfig.onerror @ RTCMultiConnection.js:594(anonymous function) @ RTCMultiConnection.js:3931getUserMedia @ RTCMultiConnection.js:3930_captureUserMedia @ RTCMultiConnection.js:678captureUserMedia @ RTCMultiConnection.js:503(anonymous function) @ RTCMultiConnection.js:118initRTCMultiSession @ RTCMultiConnection.js:228connection.open @ RTCMultiConnection.js:108_.onclick @ inter_stream.js:240
RTCMultiConnection.js:5595 original session Object {audio: true, video: true}解决方案更新为安全http,现在一切都很好,这要归功于穆阿兹汗。Chrome有一个关于安全来源的通知,并且在非安全urls的媒体访问上有一个w3c 新语境。
发布于 2015-12-16 10:06:30
chrome://settings/contentExceptions#media-stream-camera请您尝试此演示以查看系统上可用的音频/视频设备数量:https://www.webrtc-experiment.com/demos/MediaStreamTrack.getSources.html
如果Chrome上的摄像头被拒绝,您将在这里看到isWebcamAlreadyCaptured == false:https://stackoverflow.com/a/30047627/552182
此外:
https://stackoverflow.com/questions/34305323
复制相似问题