mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
fix onsignalingstatechange.
This commit is contained in:
parent
45e8ad19a9
commit
e61b04671b
@ -133,7 +133,7 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._state = this._peer.iceConnectionState
|
this._state = this._peer.iceConnectionState
|
||||||
this._log.info(`peer ice connection state changed`, { state: this._state })
|
this._log.info(`ice connection state changed`, { state: this._state })
|
||||||
|
|
||||||
switch (this._state) {
|
switch (this._state) {
|
||||||
case 'connected':
|
case 'connected':
|
||||||
@ -162,19 +162,13 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const state = this._peer.iceConnectionState
|
const state = this._peer.signalingState
|
||||||
this._log.info(`peer signaling state changed`, { state })
|
this._log.info(`signaling state changed`, { state })
|
||||||
|
|
||||||
switch (state) {
|
// The closed signaling state has been deprecated in favor of the closed iceConnectionState.
|
||||||
case 'connected':
|
// We are watching for it here to add a bit of backward compatibility.
|
||||||
this.onConnected()
|
if (state == 'closed') {
|
||||||
break
|
this.onDisconnected(new Error('signaling state changed to closed'))
|
||||||
// The closed signaling state has been deprecated in favor of the closed iceConnectionState.
|
|
||||||
// We are watching for it here to add a bit of backward compatibility.
|
|
||||||
case 'closed':
|
|
||||||
case 'failed':
|
|
||||||
this.onDisconnected(new Error('peer ' + state))
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user