Support player hotkeys when it is not focused

pull/2895/head
Chocobozzz 2020-06-04 16:06:03 +02:00
parent 275350614f
commit 7ede74add2
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 7 additions and 1 deletions

View File

@ -467,7 +467,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
this.zone.runOutsideAngular(async () => {
this.player = await PeertubePlayerManager.initialize(playerMode, playerOptions, player => this.player = player)
this.player.focus()
this.player.on('customError', ({ err }: { err: any }) => this.handleError(err))

View File

@ -452,6 +452,13 @@ export class PeertubePlayerManager {
private static addHotkeysOptions (plugins: VideoJSPluginOptions) {
Object.assign(plugins, {
hotkeys: {
skipInitialFocus: true,
enableInactiveFocus: false,
captureDocumentHotkeys: true,
documentHotkeysFocusElementFilter: (e: HTMLElement) => {
return e.id === 'content' || e.tagName.toLowerCase() === 'body'
},
enableVolumeScroll: false,
enableModifiersForNumbers: false,