WebRTC / RTCPeerConnection:无法设置本地答案sdp:调用错误状态:STATE_SENTACCEPT

时间:2014-04-22 14:03:29

标签: javascript webrtc

我正在实施网络摄像头聊天。我收到此错误Failed to set local answer sdp: Called in wrong state: STATE_SENTACCEPT

获取它的用户打开RTCPeerConnection等待来自其他用户的SDP优惠,然后执行此错误发生的代码:

function receiveOffer(offer)
{
    offer = new RTCSessionDescription(JSON.parse(offer));
    remotePc; // defined somewhere else

    remotePc.setRemoteDescription(new RTCSessionDescription(offer), function() 
    {
        remotePc.createAnswer(function(answer) 
        {
            remotePc.setLocalDescription(new RTCSessionDescription(answer), function() 
            {
                // send answer
            },error); 
        },error);
    },error);
}

引发错误的行是setLocalDescription。一般来说,有谁知道可能导致这种情况的原因?

0 个答案:

没有答案