From 18ecda3379d17bcb49b39a4d3bcf8ac8dd4fc1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC?= Date: Fri, 10 Apr 2026 21:51:03 +0800 Subject: [PATCH] fix: show Controls progress bar during drag instead of full overlay --- lib/plugin/pl_player/controller.dart | 1 + lib/plugin/pl_player/view/view.dart | 27 +++++++++---------- .../pl_player/widgets/bottom_control.dart | 3 ++- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 26e5356f3..b4d540d06 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -1667,6 +1667,7 @@ 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 95b69d0dd..b29dddd0f 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; - _isDraggingProgress.value = true; + plPlayerController.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) { - _isDraggingProgress.value = false; + plPlayerController.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; - _isDraggingProgress.value = true; + plPlayerController.isDraggingProgress.value = true; } else if (dy > 3 * dx) { _gestureType = GestureType.right; } @@ -1340,7 +1340,7 @@ class _PLVideoPlayerState extends State } void _onPointerPanZoomEnd(PointerPanZoomEndEvent event) { - _isDraggingProgress.value = false; + plPlayerController.isDraggingProgress.value = false; _gestureType = null; } @@ -1728,16 +1728,13 @@ class _PLVideoPlayerState extends State child: Obx( () { final showControls = plPlayerController.showControls.value; - final isDragging = _isDraggingProgress.value; - final offstage = isDragging - ? false - : switch (plPlayerController.progressType) { - BtmProgressBehavior.onlyShowFullScreen => - showControls || !isFullScreen, - BtmProgressBehavior.onlyHideFullScreen => - showControls || isFullScreen, - _ => showControls, - }; + final offstage = 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 ac449c0ec..2560081ff 100644 --- a/lib/plugin/pl_player/widgets/bottom_control.dart +++ b/lib/plugin/pl_player/widgets/bottom_control.dart @@ -65,7 +65,8 @@ class BottomControl extends StatelessWidget { padding: const EdgeInsets.fromLTRB(10, 0, 10, 7), child: Obx( () => Offstage( - offstage: !controller.showControls.value, + offstage: !controller.showControls.value && + !controller.isDraggingProgress.value, child: Stack( clipBehavior: Clip.none, alignment: Alignment.bottomCenter,