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')
|
Vue.set(this.state.connection, 'type', 'webrtc')
|
||||||
this.events.emit('connection.webrtc', 'connected')
|
this.events.emit('connection.webrtc', 'connected')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let webrtcReconnect: any
|
||||||
this.webrtc.on('disconnected', () => {
|
this.webrtc.on('disconnected', () => {
|
||||||
Vue.set(this.state.connection.webrtc, 'status', 'disconnected')
|
Vue.set(this.state.connection.webrtc, 'status', 'disconnected')
|
||||||
Vue.set(this.state.connection.webrtc, 'stats', null)
|
Vue.set(this.state.connection.webrtc, 'stats', null)
|
||||||
@ -417,7 +419,9 @@
|
|||||||
|
|
||||||
// reconnect WebRTC
|
// reconnect WebRTC
|
||||||
if (this.connected) {
|
if (this.connected) {
|
||||||
setTimeout(() => {
|
if (webrtcReconnect) clearTimeout(webrtcReconnect)
|
||||||
|
|
||||||
|
webrtcReconnect = setTimeout(() => {
|
||||||
try {
|
try {
|
||||||
this.webrtcConnect()
|
this.webrtcConnect()
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user