# How to handle Network/any other disruptions in WebRTC playback

**URL:** <https://community.wowza.com/t/how-to-handle-network-any-other-disruptions-in-webrtc-playback/92085>\
**Category:** Wowza Developer Dojo\
**Tags:** webrtc\
**Created:** [October 7, 2020, 5:54am UTC](https://community.wowza.com/t/how-to-handle-network-any-other-disruptions-in-webrtc-playback/92085 "2020-10-07T05:54:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alok\_Kumar2](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Alok\_Kumar2](https://community.wowza.com/u/Alok_Kumar2)\
**Post date:** [October 7, 2020, 5:54am UTC](https://community.wowza.com/t/how-to-handle-network-any-other-disruptions-in-webrtc-playback/92085/1 "2020-10-07T05:54:11Z")

</div>

Hi,

I have created an angular application to consume WebRTC streams from Wowza Streaming Engine by modifying the sample code provided on [github](https://github.com/WowzaMediaSystems/webrtc-examples/tree/master/src/lib)

I am successfully able to stream WebRTC streams in the application. I am struggling to find sample code on how to reconnect the `RTCPeerConnection` if it become `disconneted/failed` due to network on any other reason. In traditional WebRTC, one could do a RestartICE() to reestablish the connection. However this is not supported in Safari browser as per this [Doc](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/restartIce).

So now if the `RTCPeerConnection` becomes disconnected/failed, I am restarting the WeRTC playback from scratch by opening a new `WebSocket` and exchanging `SDP` and` ICE candidates` all over again. Is there any better way to do this in Wowza implementation of WebRTC or what I am doing is the only way to handle failover scenarios ?

Regards,  
Alok Kumar

---

<div class="post-metadata">

**Author:** ![Remy\_G](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/remy_g/32/487_2.png) [@Remy\_G](https://community.wowza.com/u/Remy_G)\
**Post date:** [October 7, 2020, 5:23pm UTC](https://community.wowza.com/t/how-to-handle-network-any-other-disruptions-in-webrtc-playback/92085/2 "2020-10-07T17:23:17Z")

</div>

Hey there, this is indeed the best flow currently for handling disconnects. So you restart it from scratch following the Websocket and WebRTC negotiation procedures. Should be pretty quick in most cases.
