feat(player): language-first audio & subtitle track labels

close #1307
This commit is contained in:
edde746
2026-06-12 04:16:39 +02:00
parent 133db721a2
commit ad3cc6b986
13 changed files with 497 additions and 198 deletions
+17
View File
@@ -72,6 +72,23 @@ class CodecUtils {
};
}
/// Formats an audio channel count as a friendly layout name (2 → 'Stereo',
/// 6 → '5.1'). Returns null when [channels] is null or not positive.
static String? formatAudioChannels(int? channels) {
if (channels == null || channels <= 0) return null;
return switch (channels) {
1 => 'Mono',
2 => 'Stereo',
3 => '3.0',
4 => '4.0',
5 => '4.1',
6 => '5.1',
7 => '6.1',
8 => '7.1',
_ => '${channels}ch',
};
}
/// Formats an audio codec name to a user-friendly display format.
static String formatAudioCodec(String codec) {
final lower = codec.toLowerCase();