diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-28 11:06:02 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-28 11:08:04 +0100 |
commit | d275e75453015352d5b9387eaf5078e1ba5e0ea2 (patch) | |
tree | b0f6c6b777361b59d38b0fbf50e5599c4da66d9c /client | |
parent | 3062112200322e0a7b8a369a312f041bf4e21083 (diff) | |
download | PeerTube-d275e75453015352d5b9387eaf5078e1ba5e0ea2.tar.gz PeerTube-d275e75453015352d5b9387eaf5078e1ba5e0ea2.tar.zst PeerTube-d275e75453015352d5b9387eaf5078e1ba5e0ea2.zip |
Focus player on video loading
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/videojs-components/settings-menu-item.ts | 2 |
2 files changed, 3 insertions, 0 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 c78f5b9a2..80aa8ebe4 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -477,6 +477,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
477 | 477 | ||
478 | this.zone.runOutsideAngular(async () => { | 478 | this.zone.runOutsideAngular(async () => { |
479 | this.player = await PeertubePlayerManager.initialize(mode, options, player => this.player = player) | 479 | this.player = await PeertubePlayerManager.initialize(mode, options, player => this.player = player) |
480 | this.player.focus() | ||
480 | 481 | ||
481 | this.player.on('customError', ({ err }: { err: any }) => this.handleError(err)) | 482 | this.player.on('customError', ({ err }: { err: any }) => this.handleError(err)) |
482 | 483 | ||
diff --git a/client/src/assets/player/videojs-components/settings-menu-item.ts b/client/src/assets/player/videojs-components/settings-menu-item.ts index 85172a18c..84d394c0e 100644 --- a/client/src/assets/player/videojs-components/settings-menu-item.ts +++ b/client/src/assets/player/videojs-components/settings-menu-item.ts | |||
@@ -329,6 +329,8 @@ class SettingsMenuItem extends MenuItem { | |||
329 | } | 329 | } |
330 | 330 | ||
331 | setMargin () { | 331 | setMargin () { |
332 | if (!this.size) return | ||
333 | |||
332 | const [ width ] = this.size | 334 | const [ width ] = this.size |
333 | 335 | ||
334 | this.settingsSubMenuEl_.style.marginRight = `-${width}px` | 336 | this.settingsSubMenuEl_.style.marginRight = `-${width}px` |