feat: 直播画质切换

This commit is contained in:
guozhigq
2024-03-11 00:02:11 +08:00
parent 4da6667b81
commit 98aaca286b
3 changed files with 101 additions and 1 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];
}