Implement ICE restarts
See original GitHub issueWhen network conditions change or the current route is congested, it’s possible to restart ICE and gather/select a new candidate pair. Apparently this happens very frequently with cellular networks or with certain types of NATs.
Restart is done by calling createOffer
with the iceRestart
option when iceConnectionState == 'failed'
.
As an optimization, ICE restart can be done preemptively when iceConnectionState == 'disconnected'
(before 'failed'
) and it won’t immediately bounce back to connected
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:13 (6 by maintainers)
Top Results From Across the Web
ICE restarts - WebRTC Course
How to know in WebRTC that ICE restart procedure finished successfully.
Read more >ICE restarts - Medium
As we have seen doing ICE restarts are a great way to improve the quality of a WebRTC service. They're one solution to...
Read more >RTCPeerConnection.restartIce() - Web APIs | MDN
Restarting ICE essentially resets ICE so that it creates all new candidates using new credentials. Existing media transmissions continue ...
Read more >Proper way to handle ICE restart - Google Groups
Just FYI, ICE restarts only make sense when you were connected (PeerConnection was up) and then it got to failed later on, which...
Read more >android - how to ice restart? - Stack Overflow
For doing ice restart, sender should send SDP file with different ice-pwd or ice-ufrag. IceRestart option forces PeerConnection to update ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We currently avoid glare by sending a
{ renegotiate: true }
message from the non-initiator to the initiator. We could expand this message to be{ renegotiate: { iceRestart: true/false }
. Offers from the non-initiator were not well-supported when I implemented renegotiation.I don’t think we need to listen for
negotiationeeded
. This wasn’t required for changing media, but it’s worth a test.That makes sense to me. Developers disabling trickle usually have very simple signalling setups (ie copy-paste) and we don’t want to break that.
simple-peer should detect the ice connection state
'failed'
and do this transparently (no public API, except maybe a max number of restart attempts).Restart is just renegotiation with
iceRestart: true
increateOffer
(or by callingrestartIce()
if that’s implemented in the browser).https://developer.mozilla.org/en-US/docs/Web/API/RTCOfferOptions/iceRestart https://medium.com/the-making-of-whereby/ice-restarts-5d759caceda6