- this.videoPlayerLoaded = true
-
- const self = this
- videojs(this.playerElement, videojsOptions, function () {
- self.player = this
- this.on('customError', (event, data) => {
- self.handleError(data.err)
- })
- })
- } else {
- (this.player as any).setVideoFiles(this.video.files)
+ // If autoplay is true, we don't really need a poster
+ if (this.isAutoplay() === false) {
+ this.playerElement.poster = this.video.previewUrl
+ }
+
+ const videojsOptions = {
+ controls: true,
+ autoplay: this.isAutoplay(),
+ playbackRates: [0.5, 1, 1.25, 1.5, 2],
+ plugins: {
+ peertube: {
+ videoFiles: this.video.files,
+ playerElement: this.playerElement,
+ peerTubeLink: false,
+ videoViewUrl: this.videoService.getVideoViewUrl(this.video.uuid),
+ videoDuration: this.video.duration
+ },
+ hotkeys: {
+ enableVolumeScroll: false
+ }