diff --git a/src/client.ts b/src/client.ts index a7c66dfa..52c9ef34 100644 --- a/src/client.ts +++ b/src/client.ts @@ -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();