Fix http player defaulting to audio resolution

pull/4107/head
Chocobozzz 2021-05-14 13:58:40 +02:00
parent 462212107a
commit 1a5b67b66d
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 1 deletions

View File

@ -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) {