feat: 直播画质切换

Closes #146

Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
guozhigq
2025-01-12 18:01:34 +08:00
committed by bggRGjQaUbCoE
parent 9429225029
commit 95c35cac58
3 changed files with 108 additions and 8 deletions

View File

@@ -0,0 +1,43 @@
enum LiveQuality {
dolby,
super4K,
origin,
veryHigh,
bluRay,
superHD,
smooth,
flunt,
}
extension LiveQualityCode on LiveQuality {
static final List<int> _codeList = [
30000,
20000,
10000,
400,
250,
150,
80,
];
int get code => _codeList[index];
static LiveQuality? fromCode(int code) {
final index = _codeList.indexOf(code);
if (index != -1) {
return LiveQuality.values[index];
}
return null;
}
}
extension VideoQualityDesc on LiveQuality {
static final List<String> _descList = [
'杜比',
'4K',
'原画',
'蓝光',
'超清',
'流畅',
];
get description => _descList[index];
}