removed unused connection state props.

This commit is contained in:
Miroslav Šedivý 2021-01-31 14:47:12 +01:00
parent b5432d5603
commit baffa8dde4
2 changed files with 3 additions and 12 deletions

View File

@ -87,9 +87,6 @@
websocket: this.websocket.supported ? 'disconnected' : 'unavailable',
webrtc: this.webrtc.supported ? 'disconnected' : 'unavailable',
type: 'none',
can_watch: false,
can_control: false,
clipboard_access: false,
},
video: {
playable: false,
@ -365,10 +362,12 @@
})
this.webrtc.on('connected', () => {
Vue.set(this.state.connection, 'webrtc', 'connected')
Vue.set(this.state.connection, 'type', 'webrtc')
this.events.emit('connection.webrtc', 'connected')
})
this.webrtc.on('disconnected', () => {
Vue.set(this.state.connection, 'webrtc', 'disconnected')
Vue.set(this.state.connection, 'type', 'none')
this.events.emit('connection.webrtc', 'disconnected')
if (!this._video) return
@ -382,11 +381,6 @@
}
})
// hardcoded webrtc for now
Vue.set(this.state.connection, 'type', 'webrtc')
Vue.set(this.state.connection, 'can_watch', this.webrtc.supported)
Vue.set(this.state.connection, 'can_control', this.webrtc.supported)
// check if is user logged in
this.api.session.whoami().then(() => {
Vue.set(this.state.connection, 'authenticated', true)
@ -395,7 +389,7 @@
// unmute on users first interaction
if (this.autoplay) {
document.addEventListener('click', this.unmute, { once: true })
document.addEventListener('click', () => this.unmute(), { once: true })
}
}

View File

@ -15,9 +15,6 @@ export interface Connection {
websocket: 'unavailable' | 'disconnected' | 'connecting' | 'connected'
webrtc: 'unavailable' | 'disconnected' | 'connecting' | 'connected'
type: 'webrtc' | 'fallback' | 'none'
can_watch: boolean
can_control: boolean
clipboard_access: boolean
}
/////////////////////////////