如何检查RTCPeerConnection是否正常工作

How to check if a RTCPeerConnection is working?

本文关键字:常工作 工作 是否 RTCPeerConnection 检查 何检查      更新时间:2023-09-26

我得到了一个RTCPeerConnection,当建立连接时,我想断开与web服务器的连接。

如何检查已建立的连接

CCD_ 2始终为CCD_ 3,而CCD_。

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

我不确定,这是给你的吗?

if (typeof RTCPeerConnection == "undefined") {
  Abort("RTCPeerConnection is not supported/enabled in this browser, cannot test!");
}

或者可能设置为null值以断开连接?

RTCPeerConnection = null;