From 2b6af10e9f37ccd104a9cc179e32c530a6655964 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 16 Dec 2021 14:57:00 +0100 Subject: [PATCH] Fix player with audio only resolution --- client/src/assets/player/webtorrent/webtorrent-plugin.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts index 2b9390206..16dc7a244 100644 --- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts +++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts @@ -368,11 +368,10 @@ class WebTorrentPlugin extends Plugin { private getAppropriateFile (averageDownloadSpeed?: number): VideoFile { if (this.videoFiles === undefined) return undefined + if (this.videoFiles.length === 1) return this.videoFiles[0] const files = this.videoFiles.filter(f => f.resolution.id !== 0) - if (files.length === 0) return undefined - if (files.length === 1) return files[0] // Don't change the torrent if the player ended if (this.torrent && this.torrent.progress === 1 && this.player.ended()) return this.currentVideoFile -- 2.41.0