0
votes

I have few doubt about webrtc peer to peer implementation.

  1. Is it necessary to exchange ice candidate between peer.

When I check sample code I found that

// send any ice candidates to the other peer
pc.onicecandidate = ({candidate}) => signaling.send({candidate});

........................
........................
signaling.onmessage =...........
......................
if (candidate) {
  await pc.addIceCandidate(candidate);
  1. Does the onicecandidate triggered on both peer or in offer peer only ?

I tested that without exchanging icecandidate the video stream works.

Does it create any problem in certain condition.

1

1 Answers

1
votes

ICE Candidate will help to find the shortest path to the peer. Also onIceCandidate will trigger on both peer.

Note: I tried without sending candidate to other peer that is not works for me.