如何检查RTCPeerConnection是否正常工作?

K..*_*K.. 2 javascript webrtc

我得到了RTCPeerConnection,当连接建立我想从网络服务器断开连接。

如何检查已建立的连接?

readyState总是undefinedonopen从来没有发射。

tom*_*tom 5

readyState来自该标准的早期版本。现在,您可以通过PeerConnection.oniceconnectionstatechange回调并通过查询确定PeerConnection.iceConnectionState。您要查找的状态值可能是connected