Fix embed that does not start on firefox
authorChocobozzz <florian.bigard@gmail.com>
Wed, 18 Oct 2017 16:19:35 +0000 (18:19 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Wed, 18 Oct 2017 16:19:35 +0000 (18:19 +0200)
client/src/assets/player/peertube-videojs-plugin.ts

index 090cc53ba67c42fcc886d1f9ca2f184d4dea0820..7cf3ea6ccb414f65c3c2a94ae49d8037c5bc011c 100644 (file)
@@ -216,7 +216,12 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
     if (options.autoplay === true) {
       player.updateVideoFile()
     } else {
-      player.one('play', () => player.updateVideoFile())
+      player.one('play', () => {
+        // Pause, we wait the video to load before
+        player.pause()
+
+        player.updateVideoFile(undefined, () => player.play())
+      })
     }
 
     setInterval(() => {