]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/peertube-videojs-plugin.ts
Disable auto resolution on HTTP fallback
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / peertube-videojs-plugin.ts
index fc07c35d61eca44fdead9fb29d2d9b21bd8720ec..208105d3c29c009a66b1e821fd86bae2640c9e18 100644 (file)
@@ -57,6 +57,7 @@ class PeerTubePlugin extends Plugin {
   private renderer
   private fakeRenderer
   private autoResolution = true
+  private forbidAutoResolution = false
   private isAutoResolutionObservation = false
 
   private videoViewInterval
@@ -304,11 +305,17 @@ class PeerTubePlugin extends Plugin {
     this.trigger('autoResolutionUpdate')
   }
 
-  disableAutoResolution () {
+  disableAutoResolution (forbid = false) {
+    if (forbid === true) this.forbidAutoResolution = true
+
     this.autoResolution = false
     this.trigger('autoResolutionUpdate')
   }
 
+  isAutoResolutionForbidden () {
+    return this.forbidAutoResolution === true
+  }
+
   getCurrentVideoFile () {
     return this.currentVideoFile
   }
@@ -509,6 +516,8 @@ class PeerTubePlugin extends Plugin {
   }
 
   private fallbackToHttp (done?: Function, play = true) {
+    this.disableAutoResolution(true)
+
     this.flushVideoFile(this.currentVideoFile, true)
     this.torrent = null
 
@@ -555,7 +564,7 @@ class PeerTubePlugin extends Plugin {
     this.player.controlBar.on('mouseenter', () => disableInactivity())
     settingsDialog.on('mouseenter', () => disableInactivity())
     this.player.controlBar.on('mouseleave', () => enableInactivity())
-    settingsDialog.on('mouseleave', () => enableInactivity())
+    // settingsDialog.on('mouseleave', () => enableInactivity())
   }
 
   private pickAverageVideoFile () {