diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index c46cc6d0..6d94afcd 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -1612,5 +1612,5 @@ class PlPlayerController { late final RxList dmTrend = [].obs; late final RxBool showDmChart = true.obs; - late final RxDouble videoScale = 1.0.obs; + late final RxBool showRestoreScaleBtn = false.obs; } diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index 304b67c0..91e478ea 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -704,8 +704,8 @@ class _PLVideoPlayerState extends State }, onInteractionUpdate: (ScaleUpdateDetails details) { - plPlayerController.videoScale.value = - transformationController.value.row0.x; + plPlayerController.showRestoreScaleBtn.value = + transformationController.value.row0.x != 1.0; if (interacting || _initialFocalPoint == Offset.zero) return; Offset cumulativeDelta = details.localFocalPoint - _initialFocalPoint; @@ -1147,7 +1147,7 @@ class _PLVideoPlayerState extends State // ), Obx( - () => plPlayerController.videoScale.value != 1 && + () => plPlayerController.showRestoreScaleBtn.value && plPlayerController.showControls.value ? Align( alignment: Alignment.bottomCenter, @@ -1169,7 +1169,7 @@ class _PLVideoPlayerState extends State ), ), onPressed: () async { - plPlayerController.videoScale.value = 1.0; + plPlayerController.showRestoreScaleBtn.value = false; final animController = AnimationController( vsync: this, duration: const Duration(milliseconds: 255),