From 86a9effe41a9870b28bfda58841f809bee9d6348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 27 Jun 2021 22:20:15 +0200 Subject: [PATCH] don't kill webrtc on temporary network issues #48. --- client/src/neko/base.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/neko/base.ts b/client/src/neko/base.ts index 37299205..46d7eff9 100644 --- a/client/src/neko/base.ts +++ b/client/src/neko/base.ts @@ -228,11 +228,15 @@ export abstract class BaseClient extends EventEmitter { case 'connected': this.onConnected() break + // https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling#ice_connection_state + // We don't watch the disconnected signaling state here as it can indicate temporary issues and may + // go back to a connected state after some time. Watching it would close the video call on any temporary + // network issue. case 'failed': this.onDisconnected(new Error('peer failed')) break - case 'disconnected': - this.onDisconnected(new Error('peer disconnected')) + case 'closed': + this.onDisconnected(new Error('peer closed')) break } }