mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
webrtcReconnect.
This commit is contained in:
parent
15e369da33
commit
e28b714090
@ -397,6 +397,8 @@
|
||||
Vue.set(this.state.connection, 'type', 'webrtc')
|
||||
this.events.emit('connection.webrtc', 'connected')
|
||||
})
|
||||
|
||||
let webrtcReconnect: any
|
||||
this.webrtc.on('disconnected', () => {
|
||||
Vue.set(this.state.connection.webrtc, 'status', 'disconnected')
|
||||
Vue.set(this.state.connection.webrtc, 'stats', null)
|
||||
@ -417,7 +419,9 @@
|
||||
|
||||
// reconnect WebRTC
|
||||
if (this.connected) {
|
||||
setTimeout(() => {
|
||||
if (webrtcReconnect) clearTimeout(webrtcReconnect)
|
||||
|
||||
webrtcReconnect = setTimeout(() => {
|
||||
try {
|
||||
this.webrtcConnect()
|
||||
} catch (e) {}
|
||||
|
Loading…
Reference in New Issue
Block a user