DOMException: Error processing ICE candidate

后端 未结 6 856
庸人自扰
庸人自扰 2021-02-07 00:26

I get this error DOMException: Error processing ICE candidate when I try to add an ice candidate. Here\'s the candidate:

candidate:1278028030

相关标签:
6条回答
  • 2021-02-07 01:03

    This may be outdated, but i had the same error,

    On Chrome i got DOMException: Error processing ICE candidate,

    On Firefox, there was an error that only stated DOMException.

    The additional message was: "Invalid candidate (both sdpMid and sdpMLineIndex are null).", and that was exactly the case, i really did not use them from the response i got from the signaling server about the ice candidate.

    Using those 2 values when i received the signal stopped this error from happening again.

    Hope this helps someone else.

    0 讨论(0)
  • 2021-02-07 01:05

    If you're keeping more than one RTCPeerConnection object around, you must make sure you're adding the ICE candidates and descriptions to the correct one.

    0 讨论(0)
  • 2021-02-07 01:05

    Are you adding the candidate before calling setRemoteDescription? Firefox 36 had an issue where it sent candidates before the remote description but that has been solved long since.

    0 讨论(0)
  • 2021-02-07 01:16

    This error can also occur if you attempt to connected to your own peer (local) id.

    0 讨论(0)
  • 2021-02-07 01:18

    If I make a second round of offer-answer, it works. I'm not sure why this is necessary though.

    0 讨论(0)
  • 2021-02-07 01:28

    This problem is almost totally undocumented, and to make matters worse only Google seems to be implementing the w3 webRTC standard. They also deviate from this standard.

    However, as it is most likely that this will be occurring on Chrome (I have not checked Firefox, and Safari does not implement getUserMedia()), this error message obtained by launching Chrome from the console will likely help:

    [ERROR:rtc_peer_connection_handler.cc(1439)] Error processing ICE candidate.
    [ERROR:webrtcsession.cc(1134)] ProcessIceMessage: ICE candidates can't be added without any remote session description.
    

    So there, you can't add ICE candidates without setting remote description as according to the most recent build of Chrome, and as it is 2017 with no webRTC progress except for Facebook Messenger, this looks to be valid for the foreseeable future.

    So remember to call

    if(!peerConnection || !peerConnection.remoteDescription.type){
        //push candidate onto queue...
    }
    

    and after setting the remote description, iterate the queue to add candidates with the peer connection in the right state!

    0 讨论(0)
提交回复
热议问题