By following this tutorial(for beginners)

i created the offerer and answerer ,, i used onicecandidate()

function onicecandidate(event) {
       if (!peerConnection || !event || !event.candidate) return;
       var candidate = event.candidate;
       // POST-ICE-to-other-Peer(candidate.candidate, candidate.sdpMLineIndex);
}

onicecandidate() event called many times before the awnserer even created but as tutorial says that i need to post ice to other peer (used Websocket) and (candidate.candidate, candidate.sdpMLineIndex) got many values ..

so do i need to send all values of event.candidate or i need to send the last value only ?

and can i connect only using SDP (Session Description Protocol ) only ?

有帮助吗?

解决方案

You should send all candidates, it's normal behaviour.

Also this method can be called during active connection and you also should send new value to opponent. ICE engine works all the time and searches the shortest path for communication between you and opponent.

and can i connect only using SDP (Session Description Protocol ) only ?

not sure what you mean exactly, but answer is No. You need a communication protocol for signalling. It could be Websockets, XMPP or others.

其他提示

You need to send the event.candidate values when the other peer connects. Then you can start sending values.. But before connecting you don't send them.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top