2
votes

In nearly all tutorials on WebRTC, the candidates from the onicecandidate callback are sent to the peer via the signalling server prior to createOffer(). The peer then adds the candidate via addicecandidate().

However it is also possible to signal the offer/answer with the ice candidates already built in. This can be accomplished by simply waiting for the null candidate in the onicecandidate callback before creating the offer/answer.

Are there any disadvantages to always sending the candidates via the offer/answer?

1
It is done immediately after createOffer(), not before. - jib

1 Answers

2
votes

gathering all candidates instead of using trickle ice has severe (several seconds) latency implications. This webrtchacks post is still a good description of the topic.