diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-09 09:41:26 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-09 09:41:26 +0100 |
commit | 07d6044e211a0a04a19bcc88719958ad28751b23 (patch) | |
tree | 81eb90edff11410bae13458b1341ce04855c23f4 /client/src/assets/player/peertube-plugin.ts | |
parent | 38d69d65012c8bf01bceb672be99f94fe414f275 (diff) | |
download | PeerTube-07d6044e211a0a04a19bcc88719958ad28751b23.tar.gz PeerTube-07d6044e211a0a04a19bcc88719958ad28751b23.tar.zst PeerTube-07d6044e211a0a04a19bcc88719958ad28751b23.zip |
Focus player after fullscreen
Diffstat (limited to 'client/src/assets/player/peertube-plugin.ts')
-rw-r--r-- | client/src/assets/player/peertube-plugin.ts | 8 |
1 files changed, 8 insertions, 0 deletions
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 { | |||
126 | this.initCaptions() | 126 | this.initCaptions() |
127 | 127 | ||
128 | this.listenControlBarMouse() | 128 | this.listenControlBarMouse() |
129 | |||
130 | this.listenFullScreenChange() | ||
129 | } | 131 | } |
130 | 132 | ||
131 | private runViewAdd () { | 133 | private runViewAdd () { |
@@ -198,6 +200,12 @@ class PeerTubePlugin extends Plugin { | |||
198 | return fetch(url, { method: 'PUT', body, headers }) | 200 | return fetch(url, { method: 'PUT', body, headers }) |
199 | } | 201 | } |
200 | 202 | ||
203 | private listenFullScreenChange () { | ||
204 | this.player.on('fullscreenchange', () => { | ||
205 | if (this.player.isFullscreen()) this.player.focus() | ||
206 | }) | ||
207 | } | ||
208 | |||
201 | private listenControlBarMouse () { | 209 | private listenControlBarMouse () { |
202 | this.player.controlBar.on('mouseenter', () => { | 210 | this.player.controlBar.on('mouseenter', () => { |
203 | this.mouseInControlBar = true | 211 | this.mouseInControlBar = true |