Archived
2
0

show reconnecting notify. #48

This commit is contained in:
Miroslav Šedivý
2021-07-17 19:18:21 +02:00
parent 2cff2a340f
commit b9b80ed79a
9 changed files with 30 additions and 1 deletions

View File

@ -230,6 +230,9 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
case 'connected':
this.onConnected()
break
case 'disconnected':
this[EVENT.RECONNECTING]()
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
@ -358,6 +361,7 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
this.emit('warn', `unhandled websocket event '${event}':`, payload)
}
protected abstract [EVENT.RECONNECTING](): void
protected abstract [EVENT.CONNECTING](): void
protected abstract [EVENT.CONNECTED](): void
protected abstract [EVENT.DISCONNECTED](reason?: Error): void