]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Hide big play button on autoplay
authorChocobozzz <me@florianbigard.com>
Tue, 17 Apr 2018 07:54:53 +0000 (09:54 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 17 Apr 2018 07:54:53 +0000 (09:54 +0200)
client/src/assets/player/peertube-videojs-plugin.ts
client/src/sass/video-js-custom.scss

index 83df24af6d59cf8d7351224c5d75b235b0d544e2..60c291a50fc4c6f7e856c0ade89444ed708616c9 100644 (file)
@@ -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)
index cae7ab4310cd985ecc276a36eafee83209c0b946..f77447e97baa257006f37cbd699fc83f7e5c32af 100644 (file)
@@ -115,6 +115,13 @@ $setting-transition-easing: ease-out;
     }
   }
 
+  // Hide the big play button on autoplay
+  &.vjs-has-autoplay {
+    .vjs-big-play-button {
+      display: none !important;
+    }
+  }
+
   .vjs-control-bar,
   .vjs-big-play-button,
   .vjs-settings-dialog {