Fix incorrect resolution with webtorrent videos

This commit is contained in:
Chocobozzz 2020-08-14 17:43:58 +02:00
parent 496d784d05
commit aea53cc649
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 1 additions and 2 deletions

View 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