I am trying to initiate peer to peer connection in webrtc. I am using signalr as signaling server. I am getting error in all the browser when adding ice candidate. Below is the error and line of code. Please let me know how can i fix this.
Error in Firefox:
InvalidStateError: No remoteDescription.
Error in Chrome:
DOMException: Failed to execute 'addIceCandidate' on 'RTCPeerConnection': Error processing ICE candidate
Code:
if (signal.ice) {
console.log(signal.ice);
peerConnections.addIceCandidate(new RTCIceCandidate(signal.ice)).catch(errorHandler.message);
}