mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
reconnecter use getter for connection status.
This commit is contained in:
@ -29,6 +29,10 @@ class WebsocketReconnecter extends ReconnecterAbstract {
|
||||
this._websocket.on('disconnected', (error) => this.emit('disconnect', error))
|
||||
}
|
||||
|
||||
public get connected() {
|
||||
return this._websocket.connected
|
||||
}
|
||||
|
||||
public async connect() {
|
||||
let url = this._state.url
|
||||
url = url.replace(/^http/, 'ws').replace(/\/+$/, '') + '/api/ws'
|
||||
@ -63,6 +67,10 @@ class WebrtcReconnecter extends ReconnecterAbstract {
|
||||
this._webrtc.on('disconnected', (error) => this.emit('disconnect', error))
|
||||
}
|
||||
|
||||
public get connected() {
|
||||
return this._webrtc.connected
|
||||
}
|
||||
|
||||
public async connect() {
|
||||
this._websocket.send(EVENT.SIGNAL_REQUEST, { video: this._state.webrtc.video })
|
||||
}
|
||||
|
Reference in New Issue
Block a user