aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-16 14:57:00 +0100
committerChocobozzz <me@florianbigard.com>2021-12-16 14:57:00 +0100
commit2b6af10e9f37ccd104a9cc179e32c530a6655964 (patch)
tree419a753ab42200d32f443267368cfe1ce9895475 /client/src/assets/player
parentc501f44119c8e63a2519e12085dc4fca4e874f3f (diff)
downloadPeerTube-2b6af10e9f37ccd104a9cc179e32c530a6655964.tar.gz
PeerTube-2b6af10e9f37ccd104a9cc179e32c530a6655964.tar.zst
PeerTube-2b6af10e9f37ccd104a9cc179e32c530a6655964.zip
Fix player with audio only resolution
Diffstat (limited to 'client/src/assets/player')
-rw-r--r--client/src/assets/player/webtorrent/webtorrent-plugin.ts3
1 files changed, 1 insertions, 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 {
368 368
369 private getAppropriateFile (averageDownloadSpeed?: number): VideoFile { 369 private getAppropriateFile (averageDownloadSpeed?: number): VideoFile {
370 if (this.videoFiles === undefined) return undefined 370 if (this.videoFiles === undefined) return undefined
371 if (this.videoFiles.length === 1) return this.videoFiles[0]
371 372
372 const files = this.videoFiles.filter(f => f.resolution.id !== 0) 373 const files = this.videoFiles.filter(f => f.resolution.id !== 0)
373
374 if (files.length === 0) return undefined 374 if (files.length === 0) return undefined
375 if (files.length === 1) return files[0]
376 375
377 // Don't change the torrent if the player ended 376 // Don't change the torrent if the player ended
378 if (this.torrent && this.torrent.progress === 1 && this.player.ended()) return this.currentVideoFile 377 if (this.torrent && this.torrent.progress === 1 && this.player.ended()) return this.currentVideoFile