From 1a5b67b66d8327017d7763f4b2d54abd29c345de Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 14 May 2021 13:58:40 +0200 Subject: [PATCH] Fix http player defaulting to audio resolution --- client/src/assets/player/webtorrent/webtorrent-plugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts index 6f5fbe4c9..e27a16390 100644 --- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts +++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts @@ -557,7 +557,8 @@ class WebTorrentPlugin extends Plugin { private pickAverageVideoFile () { if (this.videoFiles.length === 1) return this.videoFiles[0] - return this.videoFiles[Math.floor(this.videoFiles.length / 2)] + const files = this.videoFiles.filter(f => f.resolution.id !== 0) + return files[Math.floor(files.length / 2)] } private stopTorrent (torrent: WebTorrent.Torrent) { -- 2.41.0