Fix autoplay on non authenticated users
This commit is contained in:
parent
f9fcb010b0
commit
d4c6a3b985
|
@ -290,12 +290,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
const videojsOptions = {
|
const videojsOptions = {
|
||||||
controls: true,
|
controls: true,
|
||||||
autoplay: this.user.autoPlayVideo,
|
autoplay: this.isAutoplay(),
|
||||||
plugins: {
|
plugins: {
|
||||||
peertube: {
|
peertube: {
|
||||||
videoFiles: this.video.files,
|
videoFiles: this.video.files,
|
||||||
playerElement: this.playerElement,
|
playerElement: this.playerElement,
|
||||||
autoplay: this.user.autoPlayVideo,
|
autoplay: this.isAutoplay(),
|
||||||
peerTubeLink: false
|
peerTubeLink: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -373,4 +373,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
}, viewTimeoutSeconds * 1000)
|
}, viewTimeoutSeconds * 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private isAutoplay () {
|
||||||
|
// True by default
|
||||||
|
if (!this.user) return true
|
||||||
|
|
||||||
|
// Be sure the autoPlay is set to false
|
||||||
|
return this.user.autoPlayVideo !== false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue