From 35b4dd9b1f37dc1964e98835ee6c33fc6c3afb71 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Mon, 13 Apr 2020 00:49:10 +0200 Subject: [PATCH] that, but properly --- src/broadcast/rtc_streamer.ts | 3 ++- src/broadcast/streamer.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/broadcast/rtc_streamer.ts b/src/broadcast/rtc_streamer.ts index f337a28..8438845 100644 --- a/src/broadcast/rtc_streamer.ts +++ b/src/broadcast/rtc_streamer.ts @@ -146,7 +146,6 @@ export class WebRTCStreamer extends Streamer { switch (this.pc.iceConnectionState) { case "connected": case "completed": - case "disconnected": // using this here because disconnected may happen intermittently return "CONNECTED"; case "new": if (this.ws) { @@ -165,6 +164,8 @@ export class WebRTCStreamer extends Streamer { } case "checking": return "CONNECTING"; + case "disconnected": + return "CONNECTION_LOST_RECONNECTING"; case "failed": return "CONNECTION_LOST"; case "closed": diff --git a/src/broadcast/streamer.ts b/src/broadcast/streamer.ts index 7826d0f..107d516 100644 --- a/src/broadcast/streamer.ts +++ b/src/broadcast/streamer.ts @@ -2,7 +2,8 @@ export type ConnectionStateEnum = | "NOT_CONNECTED" | "CONNECTING" | "CONNECTED" - | "CONNECTION_LOST"; + | "CONNECTION_LOST" + | "CONNECTION_LOST_RECONNECTING"; export type ConnectionStateListener = (val: ConnectionStateEnum) => any; export abstract class Streamer {