diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 38dc6cc6..c8636320 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -274,22 +274,20 @@ class PlPlayerController { backgroundColor: Colors.black.withOpacity(subtitleBgOpaticy), ); - void updateSubtitleStyle([double? value]) { - key.currentState?.update( - subtitleViewConfiguration: SubtitleViewConfiguration( - style: subTitleStyle.copyWith( - fontSize: 16 * - (value ?? - (isFullScreen.value - ? subtitleFontScaleFS - : subtitleFontScale))), + SubtitleViewConfiguration get subtitleViewConfiguration => + SubtitleViewConfiguration( + style: subTitleStyle, padding: EdgeInsets.only( left: subtitlePaddingH.toDouble(), right: subtitlePaddingH.toDouble(), bottom: subtitlePaddingB.toDouble(), ), textScaleFactor: MediaQuery.textScalerOf(Get.context!).scale(1), - ), + ); + + void updateSubtitleStyle() { + key.currentState?.update( + subtitleViewConfiguration: subtitleViewConfiguration, ); } diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index da80f884..e7288b94 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -720,11 +720,8 @@ class _PLVideoPlayerState extends State !plPlayerController.continuePlayInBackground.value, resumeUponEnteringForegroundMode: true, // 字幕尺寸调节 - subtitleViewConfiguration: SubtitleViewConfiguration( - style: plPlayerController.subTitleStyle, - padding: const EdgeInsets.all(24.0), - textScaleFactor: MediaQuery.textScalerOf(context).scale(1), - ), + subtitleViewConfiguration: + plPlayerController.subtitleViewConfiguration, fit: plPlayerController.videoFit.value, ), ),