X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fassets%2Fplayer%2Fpeertube-videojs-plugin.ts;h=60c291a50fc4c6f7e856c0ade89444ed708616c9;hb=e6f627975bebd00d396d11442e582d80856bc6bd;hp=83df24af6d59cf8d7351224c5d75b235b0d544e2;hpb=244e76a552ef05a5067134b1065d26dd89246d8c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index 83df24af6..60c291a50 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts @@ -85,6 +85,8 @@ class PeerTubePlugin extends Plugin { this.playerElement = options.playerElement + if (this.autoplay === true) this.player.addClass('vjs-has-autoplay') + this.player.ready(() => { const volume = getStoredVolume() if (volume !== undefined) this.player.volume(volume) @@ -314,10 +316,8 @@ class PeerTubePlugin extends Plugin { if (this.autoplay === true) { this.player.posterImage.hide() - this.updateVideoFile(undefined, 0, () => { - this.seek(this.startTime) - this.player.play() - }) + + this.updateVideoFile(undefined, 0, () => this.seek(this.startTime)) } else { // Proxy first play const oldPlay = this.player.play.bind(this.player)