【发布时间】:2018-05-30 01:57:26
【问题描述】:
当我无法创建答案但连接状态已经是 have-remote-offer 时,我遇到了问题。
代码:
pc.ontrack = function(evt) {
// signaling state is have-remote-offer
logEvent('REMOTE', 'signalingstate', pc.signalingState);
pc.createAnswer() // error here
.then((answer) => {
localConnection.setLocalDescription(answer);
logEvent('REMOTE', 'signalingstate', pc.signalingState);
socket.emit('session_description', JSON.stringify({ desc: answer.toJSON() }));
});
};
错误:
Uncaught (in promise) DOMException: Peer Connection cannot create an answer in a state other than
have-remote-offer或have-local-pranswer
有什么想法吗?
【问题讨论】:
标签: javascript webrtc