diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-04 16:06:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-06-23 16:57:35 +0200 |
commit | 7ede74add2d41958f3aad0053afc812698f261a0 (patch) | |
tree | 3a367952321e64455604f708b286a8aff5f7700e /client | |
parent | 275350614fbb83b3cd51e52d74428860d696c6c7 (diff) | |
download | PeerTube-7ede74add2d41958f3aad0053afc812698f261a0.tar.gz PeerTube-7ede74add2d41958f3aad0053afc812698f261a0.tar.zst PeerTube-7ede74add2d41958f3aad0053afc812698f261a0.zip |
Support player hotkeys when it is not focused
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/+videos/+video-watch/video-watch.component.ts | 1 | ||||
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts index 5b0b34c80..933e6c51f 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts | |||
@@ -467,7 +467,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
467 | 467 | ||
468 | this.zone.runOutsideAngular(async () => { | 468 | this.zone.runOutsideAngular(async () => { |
469 | this.player = await PeertubePlayerManager.initialize(playerMode, playerOptions, player => this.player = player) | 469 | this.player = await PeertubePlayerManager.initialize(playerMode, playerOptions, player => this.player = player) |
470 | this.player.focus() | ||
471 | 470 | ||
472 | this.player.on('customError', ({ err }: { err: any }) => this.handleError(err)) | 471 | this.player.on('customError', ({ err }: { err: any }) => this.handleError(err)) |
473 | 472 | ||
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index ebb1e454a..630eebbca 100644 --- a/client/src/assets/player/peertube-player-manager.ts +++ b/client/src/assets/player/peertube-player-manager.ts | |||
@@ -452,6 +452,13 @@ export class PeertubePlayerManager { | |||
452 | private static addHotkeysOptions (plugins: VideoJSPluginOptions) { | 452 | private static addHotkeysOptions (plugins: VideoJSPluginOptions) { |
453 | Object.assign(plugins, { | 453 | Object.assign(plugins, { |
454 | hotkeys: { | 454 | hotkeys: { |
455 | skipInitialFocus: true, | ||
456 | enableInactiveFocus: false, | ||
457 | captureDocumentHotkeys: true, | ||
458 | documentHotkeysFocusElementFilter: (e: HTMLElement) => { | ||
459 | return e.id === 'content' || e.tagName.toLowerCase() === 'body' | ||
460 | }, | ||
461 | |||
455 | enableVolumeScroll: false, | 462 | enableVolumeScroll: false, |
456 | enableModifiersForNumbers: false, | 463 | enableModifiersForNumbers: false, |
457 | 464 | ||