Focus player after fullscreen

pull/4624/head
Chocobozzz 2021-12-09 09:41:26 +01:00
parent 38d69d6501
commit 07d6044e21
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 8 additions and 0 deletions

View File

@ -126,6 +126,8 @@ class PeerTubePlugin extends Plugin {
this.initCaptions()
this.listenControlBarMouse()
this.listenFullScreenChange()
}
private runViewAdd () {
@ -198,6 +200,12 @@ class PeerTubePlugin extends Plugin {
return fetch(url, { method: 'PUT', body, headers })
}
private listenFullScreenChange () {
this.player.on('fullscreenchange', () => {
if (this.player.isFullscreen()) this.player.focus()
})
}
private listenControlBarMouse () {
this.player.controlBar.on('mouseenter', () => {
this.mouseInControlBar = true