gpt4 book ai didi

RTCMultiConnection 上的 WebRTC PermissionDeniedError getUserMedia

转载 作者:行者123 更新时间:2023-12-01 10:57:46 25 4
gpt4 key购买 nike

RTCMultiConnection 上突然出现 PermissionDeniedError 和 getUserMedia 错误,而一切都运行良好。不仅在 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}

Solution Updated to secure http and everything is working well right now, thanks to Muaz Khan. Chrome has a notice about secure origins and there is a w3c new context on media access at non-secure urls.

最佳答案

  1. 请确保您使用的是 RTCMultiConnection v2.2.2。
  2. 确保您的域允许使用网络摄像头(视频):chrome://settings/contentExceptions#media-stream-camera
  3. 您似乎在使用 HTTP。这是有道理的。
  4. 您似乎使用了 {audio:true,vide:true},所以这里没有“screen:true”异常!
  5. 请尝试AppRTC demo这是使用 RTCMultiConnection v2.2.2 构建的

您能否尝试这个演示来查看您系统上可用的音频/视频设备的数量:https://www.webrtc-experiment.com/demos/MediaStreamTrack.getSources.html

如果 Chrome 上的网络摄像头被拒绝,您将在此处看到 isWebcamAlreadyCaptured == false:https://stackoverflow.com/a/30047627/552182

另外:

  1. 请分享您的浏览器版本:https://www.webrtc-experiment.com/DetectRTC/
  2. 请确保另一个应用程序(Firefox 等)使用相同的摄像头。

关于RTCMultiConnection 上的 WebRTC PermissionDeniedError getUserMedia,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34305323/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com