Fix anonymous autoplay
This commit is contained in:
parent
45ec48b2b1
commit
9684bc959e
|
@ -567,11 +567,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
// We'll jump to the thread id, so do not play the video
|
// We'll jump to the thread id, so do not play the video
|
||||||
if (this.route.snapshot.params['threadId']) return false
|
if (this.route.snapshot.params['threadId']) return false
|
||||||
|
|
||||||
// Otherwise true by default
|
if (this.user) return this.user.autoPlayVideo
|
||||||
if (!this.user) return true
|
|
||||||
|
|
||||||
// Be sure the autoPlay is set to false
|
if (this.anonymousUser) return this.anonymousUser.autoPlayVideo
|
||||||
return this.user.autoPlayVideo !== false
|
|
||||||
|
throw new Error('Cannot guess autoplay because user and anonymousUser are not defined')
|
||||||
}
|
}
|
||||||
|
|
||||||
private isAutoPlayNext () {
|
private isAutoPlayNext () {
|
||||||
|
|
Loading…
Reference in New Issue