1

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!

Gautam Kumar Samal
  • 758
  • 1
  • 7
  • 23
  • Are you solve it? – Oliver D Nov 08 '20 at 11:01
  • Hi @OliverD, the issue was not with the null candidate. At the initial connection it was sending the offer before properly setting the local description. We fixed the issue by handling the same. Hence the question statement is bit wrong in itself. Hope it helps! – Gautam Kumar Samal Nov 10 '20 at 05:36

0 Answers0