From 9684bc959ecc2ec8407aaf36d054c7e000991141 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 13 Jul 2023 14:40:06 +0200 Subject: [PATCH] Fix anonymous autoplay --- .../src/app/+videos/+video-watch/video-watch.component.ts | 8 ++++---- 1 file 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 { // We'll jump to the thread id, so do not play the video if (this.route.snapshot.params['threadId']) return false - // Otherwise true by default - if (!this.user) return true + if (this.user) return this.user.autoPlayVideo - // Be sure the autoPlay is set to false - return this.user.autoPlayVideo !== false + if (this.anonymousUser) return this.anonymousUser.autoPlayVideo + + throw new Error('Cannot guess autoplay because user and anonymousUser are not defined') } private isAutoPlayNext () {