fix dolby videos playing (#1202)

This commit is contained in:
Kofua
2025-09-07 11:35:12 +08:00
committed by GitHub
parent e02835ddc4
commit d285f00086
5 changed files with 36 additions and 23 deletions

View File

@@ -1,19 +1,19 @@
// ignore_for_file: constant_identifier_names
enum VideoDecodeFormatType {
DVH1('dvh1'),
AV1('av01'),
HEVC('hev1'),
AVC('avc1');
DVH1(['dvh1']),
AV1(['av01']),
HEVC(['hev1', 'hvc1']),
AVC(['avc1']);
String get description => name;
final String code;
final List<String> codes;
const VideoDecodeFormatType(this.code);
const VideoDecodeFormatType(this.codes);
static VideoDecodeFormatType fromCode(String code) =>
values.firstWhere((i) => i.code == code);
values.firstWhere((i) => i.codes.contains(code));
static VideoDecodeFormatType fromString(String val) =>
values.firstWhere((i) => val.startsWith(i.code));
values.firstWhere((i) => i.codes.any(val.startsWith));
}