mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-01 16:00:51 +02:00
webrtcReconnect.
This commit is contained in:
parent
15e369da33
commit
e28b714090
1 changed files with 5 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue