From 07d6044e211a0a04a19bcc88719958ad28751b23 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 9 Dec 2021 09:41:26 +0100 Subject: [PATCH] Focus player after fullscreen --- client/src/assets/player/peertube-plugin.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/assets/player/peertube-plugin.ts b/client/src/assets/player/peertube-plugin.ts index 0121e87d7..f03553184 100644 --- a/client/src/assets/player/peertube-plugin.ts +++ b/client/src/assets/player/peertube-plugin.ts @@ -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