const Plugin: VideoJSComponentInterface = videojs.getPlugin('plugin')
class PeerTubePlugin extends Plugin {
- private readonly autoplay: boolean = false
private readonly startTime: number = 0
private readonly videoViewUrl: string
private readonly videoDuration: number
this.videoDuration = options.videoDuration
this.videoCaptions = options.videoCaptions
- if (this.autoplay === true) this.player.addClass('vjs-has-autoplay')
+ if (options.autoplay === true) this.player.addClass('vjs-has-autoplay')
+
+ this.player.on('autoplay-failure', () => {
+ this.player.removeClass('vjs-has-autoplay')
+ })
this.player.ready(() => {
const playerOptions = this.player.options_