aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-04-27 12:36:14 +0200
committermetamuffin <metamuffin@disroot.org>2025-04-27 12:36:14 +0200
commit2774461d4e10f036dcaa9b78ec686b64f59be737 (patch)
tree08f2716881e96743408ed4efbd39ee3a3a91c5df /web
parent1d0fbc5c471db162ccc2c164273955515e918116 (diff)
downloadjellything-2774461d4e10f036dcaa9b78ec686b64f59be737.tar
jellything-2774461d4e10f036dcaa9b78ec686b64f59be737.tar.bz2
jellything-2774461d4e10f036dcaa9b78ec686b64f59be737.tar.zst
fix format sort to always prefer remux
Diffstat (limited to 'web')
-rw-r--r--web/script/player/track/mse.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/script/player/track/mse.ts b/web/script/player/track/mse.ts
index 7c54e28..72aa0c3 100644
--- a/web/script/player/track/mse.ts
+++ b/web/script/player/track/mse.ts
@@ -60,7 +60,10 @@ export class MSEPlayerTrack extends PlayerTrack {
this.usable_formats.push({ container, format, format_index: i, usable_index: this.usable_formats.length })
}
}
- this.usable_formats.sort((a, b) => b.format.bitrate - a.format.bitrate)
+
+ // TODO prefer newer codecs
+ const sort_key = (f: FormatInfo) => f.remux ? Infinity : f.bitrate
+ this.usable_formats.sort((a, b) => sort_key(b.format) - sort_key(a.format))
if (!this.usable_formats.length)
return this.player.logger?.log("No availble format is supported by this device. The track can't be played back.")
this.active_format.value = this.usable_formats[0]