WebRTC问题
谢谢
发布于 2013-01-30 20:59:08
我在Chrome 24和26上的实验表明,当一个对等点断开连接时,纵隔/局部纵隔或视频事件都不会触发,但是(RTCPeerConnection) icecandidate事件在断开连接后确实会触发几次:首先是与候选对象,然后在事件对象上没有它。
peer = new RTCPeerConnection({ "iceServers": [{ "url": "stun:stun.l.google.com:19302" }] });
peer.onicecandidate = function(e){
if(!e.candidate) return console.log('Did someone disconnect?',e);
console.log('Someone might have just disconnected. Or maybe not.',e);
}我还成功地连接了三个chrome上的节点:据我所知,每个对等点只连接两个对等点,因此主机可以单独连接多个同时连接。
发布于 2019-08-28 19:29:56
这就是你想要的
(await peerConnection.getStats())
.forEach((c)=>{if(c.type =='track')console.log(c)})这会告诉你已经收到了多少帧。保存它,然后再问一秒钟,比较这两种结果。如果帧数相同,则不会获得新的数据。
https://stackoverflow.com/questions/14027663
复制相似问题