mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
join clear function.
This commit is contained in:
parent
2c02a0f2f9
commit
8960bb319f
@ -274,17 +274,16 @@
|
|||||||
this.connection.websocket.send(EVENT.SIGNAL_REQUEST, { video: video })
|
this.connection.websocket.send(EVENT.SIGNAL_REQUEST, { video: video })
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Refactor.
|
|
||||||
public disconnect() {
|
public disconnect() {
|
||||||
if (!this.connected) {
|
if (!this.connected) {
|
||||||
throw new Error('client is not connected')
|
throw new Error('client is not connected')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Refactor.
|
||||||
this.connection.webrtc.disconnect()
|
this.connection.webrtc.disconnect()
|
||||||
this.clearWebRTCState()
|
|
||||||
|
|
||||||
this.connection.disconnect()
|
this.connection.disconnect()
|
||||||
this.clearWebSocketState()
|
this.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
public play() {
|
public play() {
|
||||||
@ -509,19 +508,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clearWebSocketState() {
|
clear() {
|
||||||
Vue.set(this.state.connection, 'websocket', 'disconnected')
|
|
||||||
Vue.set(this.state.connection.webrtc, 'videos', [])
|
|
||||||
Vue.set(this.state.control, 'clipboard', null)
|
|
||||||
Vue.set(this.state.control, 'host_id', null)
|
|
||||||
Vue.set(this.state.control, 'implicit_hosting', false)
|
|
||||||
Vue.set(this.state.screen, 'size', { width: 1280, height: 720, rate: 30 })
|
|
||||||
Vue.set(this.state.screen, 'configurations', [])
|
|
||||||
Vue.set(this.state, 'session_id', null)
|
|
||||||
Vue.set(this.state, 'sessions', {})
|
|
||||||
}
|
|
||||||
|
|
||||||
clearWebRTCState() {
|
|
||||||
// destroy video
|
// destroy video
|
||||||
if (this._video) {
|
if (this._video) {
|
||||||
if ('srcObject' in this._video) {
|
if ('srcObject' in this._video) {
|
||||||
@ -532,6 +519,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// websocket
|
||||||
|
Vue.set(this.state.connection, 'websocket', 'disconnected')
|
||||||
|
Vue.set(this.state.connection.webrtc, 'videos', [])
|
||||||
|
Vue.set(this.state.control, 'clipboard', null)
|
||||||
|
Vue.set(this.state.control, 'host_id', null)
|
||||||
|
Vue.set(this.state.control, 'implicit_hosting', false)
|
||||||
|
Vue.set(this.state.screen, 'size', { width: 1280, height: 720, rate: 30 })
|
||||||
|
Vue.set(this.state.screen, 'configurations', [])
|
||||||
|
Vue.set(this.state, 'session_id', null)
|
||||||
|
Vue.set(this.state, 'sessions', {})
|
||||||
|
|
||||||
|
// webrtc
|
||||||
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)
|
||||||
Vue.set(this.state.connection.webrtc, 'video', null)
|
Vue.set(this.state.connection.webrtc, 'video', null)
|
||||||
|
Loading…
Reference in New Issue
Block a user