fix: 视频解码默认格式
This commit is contained in:
@ -228,11 +228,16 @@ class VideoDetailController extends GetxController
|
|||||||
// 根据画质选编码格式
|
// 根据画质选编码格式
|
||||||
List supportDecodeFormats =
|
List supportDecodeFormats =
|
||||||
supportFormats.firstWhere((e) => e.quality == resVideoQa).codecs!;
|
supportFormats.firstWhere((e) => e.quality == resVideoQa).codecs!;
|
||||||
|
// 默认从设置中取AVC
|
||||||
try {
|
|
||||||
currentDecodeFormats = VideoDecodeFormatsCode.fromString(setting.get(
|
currentDecodeFormats = VideoDecodeFormatsCode.fromString(setting.get(
|
||||||
SettingBoxKey.defaultDecode,
|
SettingBoxKey.defaultDecode,
|
||||||
defaultValue: supportDecodeFormats.first))!;
|
defaultValue: VideoDecodeFormats.values.last.code))!;
|
||||||
|
try {
|
||||||
|
// 当前视频没有对应格式返回第一个
|
||||||
|
currentDecodeFormats =
|
||||||
|
supportDecodeFormats.contains(supportDecodeFormats)
|
||||||
|
? supportDecodeFormats
|
||||||
|
: supportDecodeFormats.first;
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
|
||||||
/// 取出符合当前解码格式的videoItem
|
/// 取出符合当前解码格式的videoItem
|
||||||
|
|||||||
Reference in New Issue
Block a user