diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index b4d540d06..26e5356f3 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -1667,7 +1667,6 @@ class PlPlayerController with BlockConfigMixin { late final Map previewCache = {}; LoadingState? videoShot; - final RxBool isDraggingProgress = false.obs; late final RxBool showPreview = false.obs; late final showSeekPreview = Pref.showSeekPreview; late final previewIndex = RxnInt(); diff --git a/lib/plugin/pl_player/view/view.dart b/lib/plugin/pl_player/view/view.dart index b29dddd0f..95b69d0dd 100644 --- a/lib/plugin/pl_player/view/view.dart +++ b/lib/plugin/pl_player/view/view.dart @@ -145,7 +145,7 @@ class _PLVideoPlayerState extends State late FullScreenMode mode; late final RxBool showRestoreScaleBtn = false.obs; - + final RxBool _isDraggingProgress = false.obs; GestureType? _gestureType; @@ -977,7 +977,7 @@ class _PLVideoPlayerState extends State final dy = cumulativeDelta.dy.abs(); if (dx > 3 * dy) { _gestureType = GestureType.horizontal; - plPlayerController.isDraggingProgress.value = true; + _isDraggingProgress.value = true; } else if (dy > 3 * dx) { if (!plPlayerController.enableSlideVolumeBrightness && !plPlayerController.enableSlideFS) { @@ -1128,7 +1128,7 @@ class _PLVideoPlayerState extends State } void _onInteractionEnd(ScaleEndDetails details) { - plPlayerController.isDraggingProgress.value = false; + _isDraggingProgress.value = false; if (plPlayerController.showSeekPreview) { plPlayerController.showPreview.value = false; } @@ -1286,7 +1286,7 @@ class _PLVideoPlayerState extends State final dy = pan.dy.abs(); if (dx > 3 * dy) { _gestureType = GestureType.horizontal; - plPlayerController.isDraggingProgress.value = true; + _isDraggingProgress.value = true; } else if (dy > 3 * dx) { _gestureType = GestureType.right; } @@ -1340,7 +1340,7 @@ class _PLVideoPlayerState extends State } void _onPointerPanZoomEnd(PointerPanZoomEndEvent event) { - plPlayerController.isDraggingProgress.value = false; + _isDraggingProgress.value = false; _gestureType = null; } @@ -1728,13 +1728,16 @@ class _PLVideoPlayerState extends State child: Obx( () { final showControls = plPlayerController.showControls.value; - final offstage = switch (plPlayerController.progressType) { - BtmProgressBehavior.onlyShowFullScreen => - showControls || !isFullScreen, - BtmProgressBehavior.onlyHideFullScreen => - showControls || isFullScreen, - _ => showControls, - }; + final isDragging = _isDraggingProgress.value; + final offstage = isDragging + ? false + : switch (plPlayerController.progressType) { + BtmProgressBehavior.onlyShowFullScreen => + showControls || !isFullScreen, + BtmProgressBehavior.onlyHideFullScreen => + showControls || isFullScreen, + _ => showControls, + }; return Offstage( offstage: offstage, child: Stack( diff --git a/lib/plugin/pl_player/widgets/bottom_control.dart b/lib/plugin/pl_player/widgets/bottom_control.dart index 2560081ff..ac449c0ec 100644 --- a/lib/plugin/pl_player/widgets/bottom_control.dart +++ b/lib/plugin/pl_player/widgets/bottom_control.dart @@ -65,8 +65,7 @@ class BottomControl extends StatelessWidget { padding: const EdgeInsets.fromLTRB(10, 0, 10, 7), child: Obx( () => Offstage( - offstage: !controller.showControls.value && - !controller.isDraggingProgress.value, + offstage: !controller.showControls.value, child: Stack( clipBehavior: Clip.none, alignment: Alignment.bottomCenter,