fix: getPlayerKey

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-28 10:16:02 +08:00
parent 1b4f588671
commit 801043468d
2 changed files with 3 additions and 3 deletions

View File

@@ -311,10 +311,10 @@ class PlPlayerController {
textScaleFactor: MediaQuery.textScalerOf(Get.context!).scale(1), textScaleFactor: MediaQuery.textScalerOf(Get.context!).scale(1),
); );
late Function getPlayerKey; Function? getPlayerKey;
void updateSubtitleStyle() { void updateSubtitleStyle() {
getPlayerKey().currentState?.update( getPlayerKey?.call()?.currentState?.update(
subtitleViewConfiguration: subtitleViewConfiguration, subtitleViewConfiguration: subtitleViewConfiguration,
); );
} }

View File

@@ -161,6 +161,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
plPlayerController.getPlayerKey = () => key;
animationController = AnimationController( animationController = AnimationController(
vsync: this, duration: const Duration(milliseconds: 100)); vsync: this, duration: const Duration(milliseconds: 100));
videoController = plPlayerController.videoController!; videoController = plPlayerController.videoController!;
@@ -169,7 +170,6 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
plPlayerController.headerControl = widget.headerControl; plPlayerController.headerControl = widget.headerControl;
plPlayerController.bottomControl = widget.bottomControl; plPlayerController.bottomControl = widget.bottomControl;
plPlayerController.danmuWidget = widget.danmuWidget; plPlayerController.danmuWidget = widget.danmuWidget;
plPlayerController.getPlayerKey = () => key;
defaultBtmProgressBehavior = GStorage.setting.get( defaultBtmProgressBehavior = GStorage.setting.get(
SettingBoxKey.btmProgressBehavior, SettingBoxKey.btmProgressBehavior,
defaultValue: BtmProgressBehavior.values.first.code); defaultValue: BtmProgressBehavior.values.first.code);