]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/peertube-plugin.ts
Add/update/delete/list my playlists
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / peertube-plugin.ts
index aacbf5f6efb5b1e09761730dd80423622ddfdb73..92ac57cf5020fe8dd6242c81939f93ac5f22d812 100644 (file)
@@ -22,7 +22,6 @@ import {
 
 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
@@ -47,7 +46,11 @@ class PeerTubePlugin extends Plugin {
     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_