diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index dbdd9fce..662f45f2 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -152,17 +152,13 @@ class VideoDetailController extends GetxController defaultAudioQa = setting.get(SettingBoxKey.defaultAudioQa, defaultValue: AudioQuality.hiRes.code); oid.value = IdUtils.bv2av(Get.parameters['bvid']!); - getSubtitle().then( - (subtitles) { - headerControl = HeaderControl( - controller: plPlayerController, - videoDetailCtr: this, - floating: floating, - bvid: bvid, - videoType: videoType, - showSubtitleBtn: subtitles.isNotEmpty, - ); - }, + getSubtitle(); + headerControl = HeaderControl( + controller: plPlayerController, + videoDetailCtr: this, + floating: floating, + bvid: bvid, + videoType: videoType, ); } @@ -439,9 +435,6 @@ class VideoDetailController extends GetxController subtitles = result['data'].subtitles; getDanmaku(subtitles); } - return subtitles; - } else { - return []; } } diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index f3b9549a..b2bed21c 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -1329,7 +1329,7 @@ class _HeaderControlState extends State { ], /// 字幕 - if (widget.showSubtitleBtn!) + if (widget.showSubtitleBtn ?? true) ComBtn( icon: const Icon( Icons.closed_caption_off,