1
0
Fork 0

Support player hotkeys when it is not focused

This commit is contained in:
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,