DOMException:处理 ICE 候选对象时出错 [英] DOMException: Error processing ICE candidate

查看:33
本文介绍了DOMException:处理 ICE 候选对象时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试添加一个 ice 候选时,我收到这个错误 DOMException: Error processing ICE 候选.这是候选人:

I get this error DOMException: Error processing ICE candidate when I try to add an ice candidate. Here's the candidate:

候选人:1278028030 1 udp 2122260223 10.0.18.123 62694 典型主机第 0 代 ufrag eGOGlVCnFLZYKTsc 网络 ID 1

candidate:1278028030 1 udp 2122260223 10.0.18.123 62694 typ host generation 0 ufrag eGOGlVCnFLZYKTsc network-id 1

此外,它并不总是发生 - 其他时候一切都很顺利.我无法重现会引发此错误的一致模式.任何有关如何解决此问题/调试的想法将不胜感激!

Moreover, it doesn't always happen - other time everything goes smoothly. I can't reproduce a consistent pattern where it would throw this error. Any ideas how to go about solving this / debugging it would be appreciated!

推荐答案

这个问题几乎完全没有记录,更糟糕的是,只有 Google 似乎正在实施 w3 webRTC 标准.他们也偏离了这个标准.

This problem is almost totally undocumented, and to make matters worse only Google seems to be implementing the w3 webRTC standard. They also deviate from this standard.

但是,由于这很可能发生在 Chrome 上(我没有检查 Firefox,并且 Safari 没有实现 getUserMedia()),因此通过从控制台可能会有所帮助:

However, as it is most likely that this will be occurring on Chrome (I have not checked Firefox, and Safari does not implement getUserMedia()), this error message obtained by launching Chrome from the console will likely help:

[ERROR:rtc_peer_connection_handler.cc(1439)] Error processing ICE candidate.
[ERROR:webrtcsession.cc(1134)] ProcessIceMessage: ICE candidates can't be added without any remote session description.

因此,根据 Chrome 的最新版本,您无法在不设置远程描述的情况下添加 ICE 候选对象,并且由于 2017 年除 Facebook Messenger 外没有任何 webRTC 进展,这在可预见的未来看起来是有效的.

So there, you can't add ICE candidates without setting remote description as according to the most recent build of Chrome, and as it is 2017 with no webRTC progress except for Facebook Messenger, this looks to be valid for the foreseeable future.

所以记得打电话

if(!peerConnection || !peerConnection.remoteDescription.type){
    //push candidate onto queue...
}

并在设置远程描述后,迭代队列以添加具有正确状态的对等连接的候选者!

and after setting the remote description, iterate the queue to add candidates with the peer connection in the right state!

这篇关于DOMException:处理 ICE 候选对象时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆