opt: PlPlayerController (#1832)

* opt: audio uri

* opt: PlPlayerController
This commit is contained in:
My-Responsitories
2026-02-10 16:33:02 +08:00
committed by GitHub
parent ed2bd069ee
commit 9411785d26
6 changed files with 91 additions and 132 deletions

View File

@@ -30,20 +30,20 @@ class BottomControl extends StatelessWidget {
controller.onChangedSliderStart(duration.timeStamp);
}
void onDragUpdate(ThumbDragDetails duration, int max) {
void onDragUpdate(ThumbDragDetails duration) {
if (!controller.isFileSource && controller.showSeekPreview) {
controller.updatePreviewIndex(duration.timeStamp.inSeconds);
}
controller.onUpdatedSliderProgress(duration.timeStamp);
}
void onSeek(Duration duration, int max) {
void onSeek(Duration duration) {
if (controller.showSeekPreview) {
controller.showPreview.value = false;
}
controller
..onChangedSliderEnd()
..onChangedSlider(duration.inSeconds.toDouble())
..onChangedSlider(duration.inSeconds)
..seekTo(Duration(seconds: duration.inSeconds), isSeek: false);
}
@@ -72,8 +72,7 @@ class BottomControl extends StatelessWidget {
children: [
Obx(() {
final int value = controller.sliderPositionSeconds.value;
final int max =
controller.durationSeconds.value.inSeconds;
final int max = controller.duration.value.inSeconds;
return ProgressBar(
progress: Duration(seconds: value),
buffered: Duration(
@@ -89,8 +88,8 @@ class BottomControl extends StatelessWidget {
thumbRadius: 7,
thumbGlowRadius: 25,
onDragStart: onDragStart,
onDragUpdate: (e) => onDragUpdate(e, max),
onSeek: (e) => onSeek(e, max),
onDragUpdate: onDragUpdate,
onSeek: onSeek,
);
}),
if (controller.enableBlock &&