aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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]