Support player hotkeys when it is not focused
This commit is contained in:
parent
275350614f
commit
7ede74add2
2 changed files with 7 additions and 1 deletions
|
@ -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))
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
Loading…
Reference in a new issue