diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-13 14:40:06 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-17 11:31:46 +0200 |
commit | 9684bc959ecc2ec8407aaf36d054c7e000991141 (patch) | |
tree | 454bc87489ba910b238a9793e3874cd9b42a776c | |
parent | 45ec48b2b15907b2d22cabc0589199de8f4d0a2d (diff) | |
download | PeerTube-9684bc959ecc2ec8407aaf36d054c7e000991141.tar.gz PeerTube-9684bc959ecc2ec8407aaf36d054c7e000991141.tar.zst PeerTube-9684bc959ecc2ec8407aaf36d054c7e000991141.zip |
Fix anonymous autoplay
-rw-r--r-- | client/src/app/+videos/+video-watch/video-watch.component.ts | 8 |
1 files changed, 4 insertions, 4 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 e0935abd7..45de62519 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts | |||
@@ -567,11 +567,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
567 | // We'll jump to the thread id, so do not play the video | 567 | // We'll jump to the thread id, so do not play the video |
568 | if (this.route.snapshot.params['threadId']) return false | 568 | if (this.route.snapshot.params['threadId']) return false |
569 | 569 | ||
570 | // Otherwise true by default | 570 | if (this.user) return this.user.autoPlayVideo |
571 | if (!this.user) return true | ||
572 | 571 | ||
573 | // Be sure the autoPlay is set to false | 572 | if (this.anonymousUser) return this.anonymousUser.autoPlayVideo |
574 | return this.user.autoPlayVideo !== false | 573 | |
574 | throw new Error('Cannot guess autoplay because user and anonymousUser are not defined') | ||
575 | } | 575 | } |
576 | 576 | ||
577 | private isAutoPlayNext () { | 577 | private isAutoPlayNext () { |