fix: 快进快退触发异常

This commit is contained in:
guozhigq
2024-06-13 22:55:54 +08:00
parent ca6f6dd531
commit 5afb50cac9
3 changed files with 6 additions and 6 deletions

View File

@ -940,7 +940,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
begin: 0.0, begin: 0.0,
end: _hideSeekBackwardButton.value ? 0.0 : 1.0, end: _hideSeekBackwardButton.value ? 0.0 : 1.0,
), ),
duration: const Duration(milliseconds: 200), duration: const Duration(milliseconds: 150),
builder: (BuildContext context, double value, builder: (BuildContext context, double value,
Widget? child) => Widget? child) =>
Opacity( Opacity(
@ -983,7 +983,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
begin: 0.0, begin: 0.0,
end: _hideSeekForwardButton.value ? 0.0 : 1.0, end: _hideSeekForwardButton.value ? 0.0 : 1.0,
), ),
duration: const Duration(milliseconds: 200), duration: const Duration(milliseconds: 150),
builder: (BuildContext context, double value, builder: (BuildContext context, double value,
Widget? child) => Widget? child) =>
Opacity( Opacity(

View File

@ -30,14 +30,14 @@ class BackwardSeekIndicatorState extends State<BackwardSeekIndicator> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
timer = Timer(const Duration(milliseconds: 400), () { timer = Timer(const Duration(milliseconds: 200), () {
widget.onSubmitted.call(value); widget.onSubmitted.call(value);
}); });
} }
void increment() { void increment() {
timer?.cancel(); timer?.cancel();
timer = Timer(const Duration(milliseconds: 400), () { timer = Timer(const Duration(milliseconds: 200), () {
widget.onSubmitted.call(value); widget.onSubmitted.call(value);
}); });
widget.onChanged.call(value); widget.onChanged.call(value);

View File

@ -30,14 +30,14 @@ class ForwardSeekIndicatorState extends State<ForwardSeekIndicator> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
timer = Timer(const Duration(milliseconds: 400), () { timer = Timer(const Duration(milliseconds: 200), () {
widget.onSubmitted.call(value); widget.onSubmitted.call(value);
}); });
} }
void increment() { void increment() {
timer?.cancel(); timer?.cancel();
timer = Timer(const Duration(milliseconds: 400), () { timer = Timer(const Duration(milliseconds: 200), () {
widget.onSubmitted.call(value); widget.onSubmitted.call(value);
}); });
widget.onChanged.call(value); widget.onChanged.call(value);