]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/video-watch.component.ts
Improve first play
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / video-watch.component.ts
index c7e26fad29aecd50fa876666d3f3919bdb8ae51d..0f7c76d0b4d75b7863be0ecea2f40c19534a302d 100644 (file)
@@ -337,11 +337,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
     if (this.videoPlayerLoaded !== true) {
       this.playerElement = this.elementRef.nativeElement.querySelector('#video-element')
 
-      // If autoplay is true, we don't really need a poster
-      if (this.isAutoplay() === false) {
-        this.playerElement.poster = this.video.previewUrl
-      }
-
       const videojsOptions = getVideojsOptions({
         autoplay: this.isAutoplay(),
         inactivityTimeout: 4000,
@@ -350,7 +345,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
         videoViewUrl: this.videoService.getVideoViewUrl(this.video.uuid),
         videoDuration: this.video.duration,
         enableHotkeys: true,
-        peertubeLink: false
+        peertubeLink: false,
+        poster: this.video.previewUrl
       })
 
       this.videoPlayerLoaded = true