admin管理员组文章数量:1316980
During establishing the video call ice candidates gathereing is started after the call to createOffer or createAnswer. I'd like to get all local ice candidates for the local peer before I call createOffer or createAnswer. This way I'll have all of them set in sdp description and there will be no need to send them separately to remote peer as they will go all together in sdp. Is it possible?
UPD: All I want is to gather Ice candidates and keep them. After I want to create offers and asnwers but without of waiting for gathering of candidates will fininsh. Also How to add Ice candidates to description manually? And Is it possible to disabale Ice candidates gathering without recreating RTCPeerConnection?
During establishing the video call ice candidates gathereing is started after the call to createOffer or createAnswer. I'd like to get all local ice candidates for the local peer before I call createOffer or createAnswer. This way I'll have all of them set in sdp description and there will be no need to send them separately to remote peer as they will go all together in sdp. Is it possible?
UPD: All I want is to gather Ice candidates and keep them. After I want to create offers and asnwers but without of waiting for gathering of candidates will fininsh. Also How to add Ice candidates to description manually? And Is it possible to disabale Ice candidates gathering without recreating RTCPeerConnection?
Share Improve this question edited Jun 7, 2015 at 11:21 Midnight Guest asked Jun 6, 2015 at 6:19 Midnight GuestMidnight Guest 1,8903 gold badges16 silver badges30 bronze badges3 Answers
Reset to default 8Candidate gathering only starts when you call setLocalDescription.
If you want an SDP with all the candidates, wait for the onicecandidate event without a candidate and inspect the peerconnection's localDescription.sdp which contains all candidates gathered so far.
You can reduce the delay by setting icecandidatepoolsize - then the browser will try and pre-gather candidates before Offer/Answer.
see: https://github./pipe/two/blob/master/index.html#L181
According to https://developer.mozilla/zh-CN/docs/Web/API/RTCPeerConnection/onicecandidate
When onicecandidate event in callback is null, issue that the peer connection has gather ice candidate plete. So at that time Create offer to other peer connection and the Offer's SDP info will contain 'a=candidate' attribute.
Reference: https://aggresss.github.io/webrtc-samples/src/content/peerconnection/pc1-mod/
本文标签: javascriptGetting WebRTC IceCandidates before createOffer or createAnswerStack Overflow
版权声明:本文标题:javascript - Getting WebRTC IceCandidates before createOffer or createAnswer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742018035a2414142.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论