I was doing a couple of cross-browser testing and while testing with Chrome to Firefox (on receiving side), I always run into this problem for the first time. After refresh it seems to be working fine.
I have a event handler bound to my peerConnection as shown below.
peerconnection.onicecandidate = handleIceCandidate;
function handleIceCandidate(event) {
console.log('icecandidate event: ', event);
if (event.candidate) {
sendMessage({
type: 'candidate',
label: event.candidate.sdpMLineIndex,
id: event.candidate.sdpMid,
candidate: event.candidate.candidate
});
} else {
console.log('End of candidates.');
}
}
On the very first time, I get null in candidate.
event.candidate = null
Any clue what may be happening here? Let me know if you need more info.
Thanks in advance!