]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/standalone/videos/embed.ts
Improve first play
[github/Chocobozzz/PeerTube.git] / client / src / standalone / videos / embed.ts
index f2ac5dca6439a900df037cf1267b8db501bfee2a..1efecd3f3dbdb7c8fe3e1fbc11f9938571ae73c8 100644 (file)
@@ -22,8 +22,6 @@ loadVideoInfo(videoId)
     const videoContainerId = 'video-container'
 
     const videoElement = document.getElementById(videoContainerId) as HTMLVideoElement
-    videoElement.poster = window.location.origin + videoInfo.previewPath
-
     let autoplay = false
 
     try {
@@ -41,7 +39,8 @@ loadVideoInfo(videoId)
       videoFiles: videoInfo.files,
       videoDuration: videoInfo.duration,
       enableHotkeys: true,
-      peertubeLink: true
+      peertubeLink: true,
+      poster: window.location.origin + videoInfo.previewPath
     })
     videojs(videoContainerId, videojsOptions, function () {
       const player = this