Revert "fix: show Controls progress bar during drag instead of full overlay"

This reverts commit 18ecda3379.
This commit is contained in:
систем
2026-04-10 22:00:12 +08:00
parent 18ecda3379
commit 8502a40987
3 changed files with 16 additions and 15 deletions

View File

@@ -1667,7 +1667,6 @@ class PlPlayerController with BlockConfigMixin {
late final Map<String, ui.Image?> previewCache = {}; late final Map<String, ui.Image?> previewCache = {};
LoadingState<VideoShotData>? videoShot; LoadingState<VideoShotData>? videoShot;
final RxBool isDraggingProgress = false.obs;
late final RxBool showPreview = false.obs; late final RxBool showPreview = false.obs;
late final showSeekPreview = Pref.showSeekPreview; late final showSeekPreview = Pref.showSeekPreview;
late final previewIndex = RxnInt(); late final previewIndex = RxnInt();

View File

@@ -145,7 +145,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
late FullScreenMode mode; late FullScreenMode mode;
late final RxBool showRestoreScaleBtn = false.obs; late final RxBool showRestoreScaleBtn = false.obs;
final RxBool _isDraggingProgress = false.obs;
GestureType? _gestureType; GestureType? _gestureType;
@@ -977,7 +977,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
final dy = cumulativeDelta.dy.abs(); final dy = cumulativeDelta.dy.abs();
if (dx > 3 * dy) { if (dx > 3 * dy) {
_gestureType = GestureType.horizontal; _gestureType = GestureType.horizontal;
plPlayerController.isDraggingProgress.value = true; _isDraggingProgress.value = true;
} else if (dy > 3 * dx) { } else if (dy > 3 * dx) {
if (!plPlayerController.enableSlideVolumeBrightness && if (!plPlayerController.enableSlideVolumeBrightness &&
!plPlayerController.enableSlideFS) { !plPlayerController.enableSlideFS) {
@@ -1128,7 +1128,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
} }
void _onInteractionEnd(ScaleEndDetails details) { void _onInteractionEnd(ScaleEndDetails details) {
plPlayerController.isDraggingProgress.value = false; _isDraggingProgress.value = false;
if (plPlayerController.showSeekPreview) { if (plPlayerController.showSeekPreview) {
plPlayerController.showPreview.value = false; plPlayerController.showPreview.value = false;
} }
@@ -1286,7 +1286,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
final dy = pan.dy.abs(); final dy = pan.dy.abs();
if (dx > 3 * dy) { if (dx > 3 * dy) {
_gestureType = GestureType.horizontal; _gestureType = GestureType.horizontal;
plPlayerController.isDraggingProgress.value = true; _isDraggingProgress.value = true;
} else if (dy > 3 * dx) { } else if (dy > 3 * dx) {
_gestureType = GestureType.right; _gestureType = GestureType.right;
} }
@@ -1340,7 +1340,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
} }
void _onPointerPanZoomEnd(PointerPanZoomEndEvent event) { void _onPointerPanZoomEnd(PointerPanZoomEndEvent event) {
plPlayerController.isDraggingProgress.value = false; _isDraggingProgress.value = false;
_gestureType = null; _gestureType = null;
} }
@@ -1728,13 +1728,16 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
child: Obx( child: Obx(
() { () {
final showControls = plPlayerController.showControls.value; final showControls = plPlayerController.showControls.value;
final offstage = switch (plPlayerController.progressType) { final isDragging = _isDraggingProgress.value;
BtmProgressBehavior.onlyShowFullScreen => final offstage = isDragging
showControls || !isFullScreen, ? false
BtmProgressBehavior.onlyHideFullScreen => : switch (plPlayerController.progressType) {
showControls || isFullScreen, BtmProgressBehavior.onlyShowFullScreen =>
_ => showControls, showControls || !isFullScreen,
}; BtmProgressBehavior.onlyHideFullScreen =>
showControls || isFullScreen,
_ => showControls,
};
return Offstage( return Offstage(
offstage: offstage, offstage: offstage,
child: Stack( child: Stack(

View File

@@ -65,8 +65,7 @@ class BottomControl extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(10, 0, 10, 7), padding: const EdgeInsets.fromLTRB(10, 0, 10, 7),
child: Obx( child: Obx(
() => Offstage( () => Offstage(
offstage: !controller.showControls.value && offstage: !controller.showControls.value,
!controller.isDraggingProgress.value,
child: Stack( child: Stack(
clipBehavior: Clip.none, clipBehavior: Clip.none,
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,