回答发送前收到ICE考生的错误 [英] Errors when ICE Candidates are received before answer is sent

查看:86
本文介绍了回答发送前收到ICE考生的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Chrome 23上建立WebRTC连接。要附加本地流,您需要允许浏览器使用相机和麦克风。在来电方,我正在检查是否可以获得本地流,直到此刻我才会发送提议。然后发送报价并且浏览器立即开始发送ICE候选人。然后,如果远程浏览器没有获得本地媒体流,那么我得到 SYNTAX_ERR :每个接收到的ICE候选人都在 peerConnection.addIceCandidate(候选人)上的DOM异常12



我检查了文件 on addIceCandidate 但没有关于先决条件的信息。



我想我可以延迟发送ICE候选人通过延迟它并等待远程客户端添加本地流的信号,但这是需要的额外通信,并且看起来不正确。



我可以以某种方式添加远程ICE候选至 webkitRTCPeerConnection ,然后再回答问题并附上本地媒体流?

>在我写下这个问题后,我的脑海里回答了一个问题......在接收ICE候选人之前,不需要附加本地流,但应该设置 remoteDescription (这应该是在收到报价时完成)。在我的代码中,我等待着设置 remoteDescription 并发送答案,直到浏览器获得本地流。


I'm establishing WebRTC connection on Chrome 23. To attach local stream you need to allow browser to use the camera and microphone. On the caller side I'm checking if local stream can be obtained and I'm not sending offer until this moment. Then offer is sent and the browser immediately starts to send ICE candidates.

Then if remote browser didn't obtained local media stream yet I get SYNTAX_ERR: DOM Exception 12 on peerConnection.addIceCandidate(candidate) for every ICE candidate received.

I checked documentation on addIceCandidate but there is no info about prerequisites.

I think I can delay sending ICE candidates from offerer by delaying it and waiting for signal that remote client added local stream, but this is additional communication needed and doesn't look right.

Can I somehow add remote ICE candidates to webkitRTCPeerConnection before answer is sent and local media stream is attached?

解决方案

After I wrote this question an answer came into my mind... There is no need for attaching local stream before receiving ICE candidates, but remoteDescription should be set (which should be done at the moment of receiving offer). In my code I waited with setting remoteDescription and sending answer until browser gets the local stream.

这篇关于回答发送前收到ICE考生的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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