mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add reconnection logic.
This commit is contained in:
parent
1fee7acaab
commit
73e043aa0d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user