aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-19 14:01:34 +0100
committerChocobozzz <me@florianbigard.com>2017-12-19 14:01:34 +0100
commitd4c6a3b985ea56f730d11fb1c5f04a4fdc86e4dc (patch)
tree57f24a88391532643c0bcfaecf635accaf3ad3d5
parentf9fcb010b03fed60f07b5e09d4dfc8ba2a720741 (diff)
downloadPeerTube-d4c6a3b985ea56f730d11fb1c5f04a4fdc86e4dc.tar.gz
PeerTube-d4c6a3b985ea56f730d11fb1c5f04a4fdc86e4dc.tar.zst
PeerTube-d4c6a3b985ea56f730d11fb1c5f04a4fdc86e4dc.zip
Fix autoplay on non authenticated users
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts
index e35b02f3f..3b5edc27a 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -290,12 +290,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
290 290
291 const videojsOptions = { 291 const videojsOptions = {
292 controls: true, 292 controls: true,
293 autoplay: this.user.autoPlayVideo, 293 autoplay: this.isAutoplay(),
294 plugins: { 294 plugins: {
295 peertube: { 295 peertube: {
296 videoFiles: this.video.files, 296 videoFiles: this.video.files,
297 playerElement: this.playerElement, 297 playerElement: this.playerElement,
298 autoplay: this.user.autoPlayVideo, 298 autoplay: this.isAutoplay(),
299 peerTubeLink: false 299 peerTubeLink: false
300 } 300 }
301 } 301 }
@@ -373,4 +373,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
373 373
374 }, viewTimeoutSeconds * 1000) 374 }, viewTimeoutSeconds * 1000)
375 } 375 }
376
377 private isAutoplay () {
378 // True by default
379 if (!this.user) return true
380
381 // Be sure the autoPlay is set to false
382 return this.user.autoPlayVideo !== false
383 }
376} 384}