From: Chocobozzz Date: Fri, 14 Aug 2020 15:43:58 +0000 (+0200) Subject: Fix incorrect resolution with webtorrent videos X-Git-Tag: v2.4.0-rc.1~79 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=aea53cc64919b3a3ecfdf78b6b15c6a4d6edeea1;hp=496d784d0534cb09b97909d37b0e400d81a9078a;p=github%2FChocobozzz%2FPeerTube.git Fix incorrect resolution with webtorrent videos --- diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts index f9c050b84..5c8aca1f8 100644 --- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts +++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts @@ -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