Skip to content

Commit

Permalink
fix: iOS restartIce on failed iceConnectionState (#231)
Browse files Browse the repository at this point in the history
looks good
  • Loading branch information
brendanmoore authored May 29, 2022
1 parent f282391 commit d01eece
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export class Transport {
};

this.pc.oniceconnectionstatechange = async (e) => {
if (this.pc.iceConnectionState === 'disconnected') {
// iOS iceConnectionState can go straight to "failed" without emitting "disconnected"
if (this.pc.iceConnectionState === 'disconnected' || this.pc.iceConnectionState === 'failed') {
if (this.pc.restartIce !== undefined) {
// this will trigger onNegotiationNeeded
this.pc.restartIce();
Expand Down

0 comments on commit d01eece

Please sign in to comment.