mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
mod: progressbar
Closes #379 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -484,6 +484,9 @@ class _RenderProgressBar extends RenderBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _onDragStart(DragStartDetails details) {
|
void _onDragStart(DragStartDetails details) {
|
||||||
|
if (onDragStart == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
_userIsDraggingThumb = true;
|
_userIsDraggingThumb = true;
|
||||||
_updateThumbPosition(details.localPosition);
|
_updateThumbPosition(details.localPosition);
|
||||||
onDragStart?.call(ThumbDragDetails(
|
onDragStart?.call(ThumbDragDetails(
|
||||||
@@ -494,6 +497,9 @@ class _RenderProgressBar extends RenderBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _onDragUpdate(DragUpdateDetails details) {
|
void _onDragUpdate(DragUpdateDetails details) {
|
||||||
|
if (onDragUpdate == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
_updateThumbPosition(details.localPosition);
|
_updateThumbPosition(details.localPosition);
|
||||||
onDragUpdate?.call(ThumbDragDetails(
|
onDragUpdate?.call(ThumbDragDetails(
|
||||||
timeStamp: _currentThumbDuration(),
|
timeStamp: _currentThumbDuration(),
|
||||||
@@ -503,6 +509,9 @@ class _RenderProgressBar extends RenderBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _onDragEnd(DragEndDetails details) {
|
void _onDragEnd(DragEndDetails details) {
|
||||||
|
if (onSeek == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
onDragEnd?.call();
|
onDragEnd?.call();
|
||||||
onSeek?.call(_currentThumbDuration());
|
onSeek?.call(_currentThumbDuration());
|
||||||
_finishDrag();
|
_finishDrag();
|
||||||
|
|||||||
@@ -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/duration.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/models/fullscreen_mode.dart';
|
import 'package:PiliPlus/plugin/pl_player/models/fullscreen_mode.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/utils.dart';
|
import 'package:PiliPlus/plugin/pl_player/utils.dart';
|
||||||
import 'package:PiliPlus/utils/feed_back.dart';
|
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
import 'package:saver_gallery/saver_gallery.dart';
|
import 'package:saver_gallery/saver_gallery.dart';
|
||||||
import 'package:screen_brightness/screen_brightness.dart';
|
import 'package:screen_brightness/screen_brightness.dart';
|
||||||
@@ -1396,32 +1395,32 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
thumbColor: colorTheme,
|
thumbColor: colorTheme,
|
||||||
barHeight: 3.5,
|
barHeight: 3.5,
|
||||||
thumbRadius: draggingFixedProgressBar.value ? 7 : 2.5,
|
thumbRadius: draggingFixedProgressBar.value ? 7 : 2.5,
|
||||||
onDragStart: (duration) {
|
// onDragStart: (duration) {
|
||||||
feedBack();
|
// feedBack();
|
||||||
plPlayerController.onChangedSliderStart();
|
// plPlayerController.onChangedSliderStart();
|
||||||
},
|
// },
|
||||||
onDragUpdate: (duration) {
|
// onDragUpdate: (duration) {
|
||||||
plPlayerController
|
// plPlayerController
|
||||||
.onUpdatedSliderProgress(duration.timeStamp);
|
// .onUpdatedSliderProgress(duration.timeStamp);
|
||||||
if (plPlayerController.showSeekPreview) {
|
// if (plPlayerController.showSeekPreview) {
|
||||||
if (plPlayerController.showPreview.value.not) {
|
// if (plPlayerController.showPreview.value.not) {
|
||||||
plPlayerController.showPreview.value = true;
|
// plPlayerController.showPreview.value = true;
|
||||||
}
|
// }
|
||||||
plPlayerController.previewDx.value =
|
// plPlayerController.previewDx.value =
|
||||||
duration.localPosition.dx;
|
// duration.localPosition.dx;
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
onSeek: (duration) {
|
// onSeek: (duration) {
|
||||||
if (plPlayerController.showSeekPreview) {
|
// if (plPlayerController.showSeekPreview) {
|
||||||
plPlayerController.showPreview.value = false;
|
// plPlayerController.showPreview.value = false;
|
||||||
}
|
// }
|
||||||
plPlayerController.onChangedSliderEnd();
|
// plPlayerController.onChangedSliderEnd();
|
||||||
plPlayerController
|
// plPlayerController
|
||||||
.onChangedSlider(duration.inSeconds.toDouble());
|
// .onChangedSlider(duration.inSeconds.toDouble());
|
||||||
plPlayerController.seekTo(
|
// plPlayerController.seekTo(
|
||||||
Duration(seconds: duration.inSeconds),
|
// Duration(seconds: duration.inSeconds),
|
||||||
type: 'slider');
|
// type: 'slider');
|
||||||
},
|
// },
|
||||||
),
|
),
|
||||||
if (plPlayerController.segmentList.isNotEmpty)
|
if (plPlayerController.segmentList.isNotEmpty)
|
||||||
Positioned(
|
Positioned(
|
||||||
|
|||||||
Reference in New Issue
Block a user