diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 12 |
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 | } |