mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
fallback on webrtc disconnect.
This commit is contained in:
parent
1905d7fcd2
commit
a43ed3f6ba
@ -35,7 +35,7 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
|
||||
this._state = state
|
||||
|
||||
// initial state
|
||||
Vue.set(this._state, 'type', 'webrtc')
|
||||
Vue.set(this._state, 'type', 'screencast')
|
||||
|
||||
// websocket
|
||||
this.websocket.on('connected', () => {
|
||||
@ -56,12 +56,15 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
|
||||
if (this.websocket.connected && this.webrtc.connected) {
|
||||
Vue.set(this._state, 'status', 'connected')
|
||||
}
|
||||
|
||||
Vue.set(this._state, 'type', 'webrtc')
|
||||
})
|
||||
this.webrtc.on('disconnected', () => {
|
||||
if (this._state.status === 'connected') {
|
||||
Vue.set(this._state, 'status', 'disconnected')
|
||||
}
|
||||
|
||||
Vue.set(this._state, 'type', 'screencast')
|
||||
this._webrtcReconnect()
|
||||
})
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
:muted="autoplay"
|
||||
playsinline
|
||||
/>
|
||||
<neko-screencast v-if="state.connection.type == 'screencast'" :api="api.room" />
|
||||
<neko-screencast v-if="state.connection.type == 'screencast' && state.connection.screencast" :api="api.room" />
|
||||
<neko-overlay
|
||||
:webrtc="connection.webrtc"
|
||||
:scroll="state.control.scroll"
|
||||
|
Loading…
Reference in New Issue
Block a user