diff --git a/lib/common/widgets/audio_video_progress_bar.dart b/lib/common/widgets/audio_video_progress_bar.dart index 6e1307e55..9bd66e5a8 100644 --- a/lib/common/widgets/audio_video_progress_bar.dart +++ b/lib/common/widgets/audio_video_progress_bar.dart @@ -484,6 +484,9 @@ class _RenderProgressBar extends RenderBox { } void _onDragStart(DragStartDetails details) { + if (onDragStart == null) { + return; + } _userIsDraggingThumb = true; _updateThumbPosition(details.localPosition); onDragStart?.call(ThumbDragDetails( @@ -494,6 +497,9 @@ class _RenderProgressBar extends RenderBox { } void _onDragUpdate(DragUpdateDetails details) { + if (onDragUpdate == null) { + return; + } _updateThumbPosition(details.localPosition); onDragUpdate?.call(ThumbDragDetails( timeStamp: _currentThumbDuration(), @@ -503,6 +509,9 @@ class _RenderProgressBar extends RenderBox { } void _onDragEnd(DragEndDetails details) { + if (onSeek == null) { + return; + } onDragEnd?.call(); onSeek?.call(_currentThumbDuration()); _finishDrag(); diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index ea3b8ad0d..1a9ccd633 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -24,7 +24,6 @@ import 'package:PiliPlus/plugin/pl_player/controller.dart'; import 'package:PiliPlus/plugin/pl_player/models/duration.dart'; import 'package:PiliPlus/plugin/pl_player/models/fullscreen_mode.dart'; import 'package:PiliPlus/plugin/pl_player/utils.dart'; -import 'package:PiliPlus/utils/feed_back.dart'; import 'package:PiliPlus/utils/storage.dart'; import 'package:saver_gallery/saver_gallery.dart'; import 'package:screen_brightness/screen_brightness.dart'; @@ -1396,32 +1395,32 @@ class _PLVideoPlayerState extends State thumbColor: colorTheme, barHeight: 3.5, thumbRadius: draggingFixedProgressBar.value ? 7 : 2.5, - onDragStart: (duration) { - feedBack(); - plPlayerController.onChangedSliderStart(); - }, - onDragUpdate: (duration) { - plPlayerController - .onUpdatedSliderProgress(duration.timeStamp); - if (plPlayerController.showSeekPreview) { - if (plPlayerController.showPreview.value.not) { - plPlayerController.showPreview.value = true; - } - plPlayerController.previewDx.value = - duration.localPosition.dx; - } - }, - onSeek: (duration) { - if (plPlayerController.showSeekPreview) { - plPlayerController.showPreview.value = false; - } - plPlayerController.onChangedSliderEnd(); - plPlayerController - .onChangedSlider(duration.inSeconds.toDouble()); - plPlayerController.seekTo( - Duration(seconds: duration.inSeconds), - type: 'slider'); - }, + // onDragStart: (duration) { + // feedBack(); + // plPlayerController.onChangedSliderStart(); + // }, + // onDragUpdate: (duration) { + // plPlayerController + // .onUpdatedSliderProgress(duration.timeStamp); + // if (plPlayerController.showSeekPreview) { + // if (plPlayerController.showPreview.value.not) { + // plPlayerController.showPreview.value = true; + // } + // plPlayerController.previewDx.value = + // duration.localPosition.dx; + // } + // }, + // onSeek: (duration) { + // if (plPlayerController.showSeekPreview) { + // plPlayerController.showPreview.value = false; + // } + // plPlayerController.onChangedSliderEnd(); + // plPlayerController + // .onChangedSlider(duration.inSeconds.toDouble()); + // plPlayerController.seekTo( + // Duration(seconds: duration.inSeconds), + // type: 'slider'); + // }, ), if (plPlayerController.segmentList.isNotEmpty) Positioned(