fullscreen.

This commit is contained in:
Miroslav Šedivý 2020-11-08 22:16:47 +01:00
parent fc928f4ed2
commit 869b27161b
3 changed files with 19 additions and 5 deletions

View File

@ -83,9 +83,9 @@
</select>
</td>
</tr>
<tr>
<th>screen.is_fullscreen</th>
<td>{{ neko.state.screen.is_fullscreen }}</td>
<tr class="ok">
<th>screen.fullscreen</th>
<td><input type="checkbox" v-model="neko.state.screen.fullscreen" /></td>
</tr>
<tr class="ok">
<th>member.id</th>

View File

@ -105,7 +105,7 @@
rate: 30,
},
configurations: [],
is_fullscreen: false,
fullscreen: false,
},
member: {
id: null,
@ -151,6 +151,15 @@
this.onResize()
}
@Watch('state.screen.fullscreen')
onScreenFullscreenChanged() {
if (document.fullscreenElement !== null) {
document.exitFullscreen()
} else {
this._component.requestFullscreen()
}
}
public control = {
request: () => {
this.websocket.send('control/request')
@ -200,6 +209,11 @@
Vue.set(this.state.member, 'is_controlling', id != null && id === this.state.member.id)
})
this._component.addEventListener('fullscreenchange', () => {
Vue.set(this.state.screen, 'fullscreen', document.fullscreenElement !== null)
this.onResize()
})
// Video
VideoRegister(this.video, this.state.video)

View File

@ -47,7 +47,7 @@ export interface Scroll {
export interface Screen {
size: ScreenSize
configurations: ScreenSize[]
is_fullscreen: boolean
fullscreen: boolean
}
export interface ScreenSize {