opt: select dialog & feat: select subtitle if muted (#564)

* opt: select dialog

* opt: subtitle

* feat: select subtitle if muted
This commit is contained in:
My-Responsitories
2025-03-29 17:52:06 +08:00
committed by GitHub
parent 2ddfea5cf3
commit 82f9f48a8e
10 changed files with 284 additions and 236 deletions

View File

@@ -56,7 +56,7 @@ extension VideoQualityDesc on VideoQuality {
'杜比视界',
'8K 超高清'
];
get description => _descList[index];
String get description => _descList[index];
}
///
@@ -89,7 +89,7 @@ extension AudioQualityDesc on AudioQuality {
'杜比全景声',
'Hi-Res无损',
];
get description => _descList[index];
String get description => _descList[index];
}
enum VideoDecodeFormats {
@@ -101,12 +101,12 @@ enum VideoDecodeFormats {
extension VideoDecodeFormatsDesc on VideoDecodeFormats {
static final List<String> _descList = ['DVH1', 'AV1', 'HEVC', 'AVC'];
get description => _descList[index];
String get description => _descList[index];
}
extension VideoDecodeFormatsCode on VideoDecodeFormats {
static final List<String> _codeList = ['dvh1', 'av01', 'hev1', 'avc1'];
get code => _codeList[index];
String get code => _codeList[index];
static VideoDecodeFormats? fromCode(String code) {
final index = _codeList.indexOf(code);

View File

@@ -1,16 +1,17 @@
enum SubtitlePreference { off, on, withoutAi }
enum SubtitlePreference { off, on, withoutAi, auto }
extension SubtitlePreferenceDesc on SubtitlePreference {
static final List<String> _descList = [
'默认不显示字幕',
'选择第一个可用字幕',
'跳过自动生成(ai)字幕,选择第一个可用字幕'
'优先选择非自动生成(ai)字幕',
'跳过自动生成(ai)字幕,选择第一个可用字幕',
'静音时等同第二项,非静音时等同第三项'
];
get description => _descList[index];
String get description => _descList[index];
}
extension SubtitlePreferenceCode on SubtitlePreference {
static final List<String> _codeList = ['off', 'on', 'withoutAi'];
static const List<String> _codeList = ['off', 'on', 'withoutAi', 'auto'];
String get code => _codeList[index];
static SubtitlePreference? fromCode(String code) {