From 1884801ed2934341de740556fac55c9dd96efcbb Mon Sep 17 00:00:00 2001 From: guozhigq Date: Mon, 21 Aug 2023 18:35:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=86=E9=A2=91=E8=A7=A3=E7=A0=81?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/controller.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 0157006d..a7ea10f4 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -228,11 +228,16 @@ class VideoDetailController extends GetxController // 根据画质选编码格式 List supportDecodeFormats = supportFormats.firstWhere((e) => e.quality == resVideoQa).codecs!; - + // 默认从设置中取AVC + currentDecodeFormats = VideoDecodeFormatsCode.fromString(setting.get( + SettingBoxKey.defaultDecode, + defaultValue: VideoDecodeFormats.values.last.code))!; try { - currentDecodeFormats = VideoDecodeFormatsCode.fromString(setting.get( - SettingBoxKey.defaultDecode, - defaultValue: supportDecodeFormats.first))!; + // 当前视频没有对应格式返回第一个 + currentDecodeFormats = + supportDecodeFormats.contains(supportDecodeFormats) + ? supportDecodeFormats + : supportDecodeFormats.first; } catch (_) {} /// 取出符合当前解码格式的videoItem