From a43ed3f6ba97179b863a4569e0ab49213ad57239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Wed, 14 Jul 2021 15:49:28 +0200 Subject: [PATCH] fallback on webrtc disconnect. --- src/component/internal/connection.ts | 5 ++++- src/component/main.vue | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/component/internal/connection.ts b/src/component/internal/connection.ts index bca94c7c..f7945e47 100644 --- a/src/component/internal/connection.ts +++ b/src/component/internal/connection.ts @@ -35,7 +35,7 @@ export class NekoConnection extends EventEmitter { this._state = state // initial state - Vue.set(this._state, 'type', 'webrtc') + Vue.set(this._state, 'type', 'screencast') // websocket this.websocket.on('connected', () => { @@ -56,12 +56,15 @@ export class NekoConnection extends EventEmitter { if (this.websocket.connected && this.webrtc.connected) { Vue.set(this._state, 'status', 'connected') } + + Vue.set(this._state, 'type', 'webrtc') }) this.webrtc.on('disconnected', () => { if (this._state.status === 'connected') { Vue.set(this._state, 'status', 'disconnected') } + Vue.set(this._state, 'type', 'screencast') this._webrtcReconnect() }) diff --git a/src/component/main.vue b/src/component/main.vue index 3425f047..ca1dd121 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -8,7 +8,7 @@ :muted="autoplay" playsinline /> - +