调用createAnswer
没有改变signalingState
,它仍然在have-remote-offer
。这可能是什么原因。
offerSdp = { "sdp": offerSdp, "type": "offer" };
pc.setRemoteDescription(new RTCSessionDescription(offerSdp)).then(() => {
pc.createAnswer().then(answer => {
//state still have-remote-offer
pc.setLocalDescription(new RTCSessionDescription(answer)).then(() => {
deferred.resolve(answer.sdp)
});
});
});