mirror of https://github.com/Chocobozzz/PeerTube
Support player hotkeys when it is not focused
parent
275350614f
commit
7ede74add2
|
@ -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 New Issue