# Handle video freeze on bad network conditions

**URL:** <https://discourse.lynckia.com/t/handle-video-freeze-on-bad-network-conditions/897>\
**Category:** Support\
**Created:** [March 1, 2019, 5:01pm UTC](https://discourse.lynckia.com/t/handle-video-freeze-on-bad-network-conditions/897 "2019-03-01T17:01:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [March 1, 2019, 5:01pm UTC](https://discourse.lynckia.com/t/handle-video-freeze-on-bad-network-conditions/897/1 "2019-03-01T17:01:26Z")

</div>

In a bad network condition with high amount of packet loss it’s very common that the audio or video subscription is failed and dropped. AFAIK the only way to detect and restore the stream is by listening to the `stream-failed` event and re-subscribe to that stream. The problem with this approach is that the event is called very late and after a timeout (30s or more). Any one has a better idea for handing audio/video drops? Or any way to decrease the timeout?

---

<div class="post-metadata">

**Author:** ![Cracker\_F](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/cracker_f/32/137_2.png) [@Cracker\_F](https://discourse.lynckia.com/u/Cracker_F)\
**Post date:** [March 25, 2019, 9:44am UTC](https://discourse.lynckia.com/t/handle-video-freeze-on-bad-network-conditions/897/2 "2019-03-25T09:44:52Z")

</div>

hey, I would use: [https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/getStats](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/getStats)  
as mentioned at: [https://stackoverflow.com/questions/35577657/detect-offline-peer-in-webrtc-connection](https://stackoverflow.com/questions/35577657/detect-offline-peer-in-webrtc-connection)  
The post is a bit older so this should work in chrome as well.

---

<div class="post-metadata">

**Author:** ![mkh](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/mkh/32/38_2.png) [@mkh](https://discourse.lynckia.com/u/mkh)\
**Post date:** [March 25, 2019, 10:40am UTC](https://discourse.lynckia.com/t/handle-video-freeze-on-bad-network-conditions/897/3 "2019-03-25T10:40:00Z")

</div>

Thanks for the tip 👌  
I’ll give it a try.
