Hi,
I have seen some examples where, for the local RTCPeerConnection, the local ICE candidates are sent to the remote as they are being received inside the RTCPeerConnection.onicecandidate() callback. I have also seen examples of the local Offer SDP where all of the local ICE candidates are appended to the bottom of the Offer SDP.
Considering a case where the local agent is receive only (is not sending any streams to the remote), when should the local Offer be sent to the remote? That is, should I append each local ICE candidate to the local Offer SDP as they are coming in (in the onicecandidate callback) and then send the complete local Offer to the remote end? Or should I send the local Offer SDP to the remote agent when I get it (in the createOffer success callback) and separately send each local ICE candidate to the remote agent as they come in (in the onicecandidate callback)?
If appending each ICE candidate to the local Offer before sending the complete Offer to the remote, how do I know when I have received the LAST local ICE candidate? Currently I am receiving 4 local ICE candidates. Will I always get 4? I tried different values of iceCandidatePoolSize property of the RTCPeerConnection configuration but that did not change the number of ICE candidates I receive.
Thanks,
-Andres