Reputation: 1840
I am trying to connect two peer in flutter webrtc but i am getting below error.I am using firebase as a signalling server.
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Unable to RTCPeerConnection::setRemoteDescription: peerConnectionSetRemoteDescription(): WEBRTC_SET_REMOTE_DESCRIPTION_ERROR: Failed to set remote answer sdp: Called in wrong state: stable
I am using below code in listening to the changes in firebase
if (val['t'] == "ans") {
assert(isInitiator);
_peerCon.setRemoteDescription(
RTCSessionDescription(
val['sdp'],
val['tp'],
),
);
return;
}
Upvotes: 2
Views: 2073
Reputation: 2085
One peer connection can only set one remote description.
You are trying to setRemoteDescription
on a peer with an already established connection. That's why you getting this error.
Check this thread for more details: Failed to set remote answer sdp: Called in wrong state: stable
Upvotes: 2