检测WebRTC连接中的脱机对等体 [英] Detect offline peer in WebRTC connection
问题描述
我们正在使用WebRTC开发从移动设备到计算机的视频流。移动设备可能完全失去连接,计算机应该能够检测到它。现在,视频就冻结了。但是没有 EventHandler
s在这种情况下会调用 RTCPeerConnection
。
We are developing a video stream from a mobile device to a computer using WebRTC. The mobile device might lose its connection completely and the computer should be able to detect that. Right now, the video just freezes. But neither of the EventHandler
s of RTCPeerConnection
are called in such a situation.
- 那怎么能在另一个对等体上检测到这样的连接失败?
- 对等体如何首先检测连接建立时的连接问题?
推荐答案
iceconnectionstatechange处理程序应该在大约5-10秒后不再从对等方接收数据时触发(在Chrome中; Firefox目前正在处理) 。请参阅 https://webrtc.github.io/samples/src/content/peerconnection/states/例如。
the iceconnectionstatechange handler should fire after ~5-10 seconds of not receiving data from the peer anymore (in Chrome; Firefox is working on that currently). See https://webrtc.github.io/samples/src/content/peerconnection/states/ for an example.
这篇关于检测WebRTC连接中的脱机对等体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!