diff --git a/src/component/main.vue b/src/component/main.vue index 25183d6f..201eb09c 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -341,6 +341,15 @@ this.webrtc.disconnect() this.clearState() + + // reconnect WebRTC + if (this.authenticated) { + setTimeout(() => { + try { + this.websocketConnect() + } catch (e) {} + }, 1000) + } }) // webrtc @@ -377,6 +386,7 @@ }) this.webrtc.on('disconnected', () => { Vue.set(this.state.connection, 'webrtc', 'disconnected') + Vue.set(this.state.connection, 'webrtc_stats', null) Vue.set(this.state.connection, 'type', 'none') this.events.emit('connection.webrtc', 'disconnected') @@ -389,6 +399,15 @@ // @ts-ignore this._video.removeAttribute('src') } + + // reconnect WebRTC + if (this.connected) { + setTimeout(() => { + try { + this.webrtcConnect() + } catch (e) {} + }, 1000) + } }) // check if is user logged in