Question

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 ?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top