]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix incorrect resolution with webtorrent videos
authorChocobozzz <me@florianbigard.com>
Fri, 14 Aug 2020 15:43:58 +0000 (17:43 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 14 Aug 2020 15:45:00 +0000 (17:45 +0200)
client/src/assets/player/webtorrent/webtorrent-plugin.ts

index f9c050b841e0cd9f8a871af7ea41d5e433d9f1ae..5c8aca1f8337f4f9363ab6783f9666fbb499cdbd 100644 (file)
@@ -369,11 +369,10 @@ class WebTorrentPlugin extends Plugin {
     if (files.length === 0) return undefined
     if (files.length === 1) return files[0]
 
-    // Don't change the torrent is the play was ended
+    // Don't change the torrent if the player ended
     if (this.torrent && this.torrent.progress === 1 && this.player.ended()) return this.currentVideoFile
 
     if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed()
-    averageDownloadSpeed = 0
 
     // Limit resolution according to player height
     const playerHeight = this.playerElement.offsetHeight