From 4dd551a06642351786c28d39fe3fe29939baca54 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Oct 2017 18:19:35 +0200 Subject: Fix embed that does not start on firefox --- client/src/assets/player/peertube-videojs-plugin.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index 090cc53ba..7cf3ea6cc 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts @@ -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(() => { -- cgit v1.2.3