Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Focus player on video loading

Chocobozzzd275e7545301
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 c78f5b9a22..80aa8ebe47 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 {
this.zone.runOutsideAngular(async () => {
this.player = await PeertubePlayerManager.initialize(mode, options, player => this.player = player)
+ this.player.focus()
this.player.on('customError', ({ err }: { err: any }) => this.handleError(err))
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 85172a18c0..84d394c0ea 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 {
}
setMargin () {
+ if (!this.size) return
+
const [ width ] = this.size
this.settingsSubMenuEl_.style.marginRight = `-${width}px`