From 32f6d972567d03aaa718665138bd666329a7bcd3 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sat, 4 Oct 2025 11:16:24 +0800 Subject: [PATCH] opt play Signed-off-by: bggRGjQaUbCoE --- lib/plugin/pl_player/controller.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index fe1f088fb..a2b3aaddf 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -1436,11 +1436,14 @@ class PlPlayerController { return (duration.inMilliseconds / 1000).round(); } + bool get _isCompleted => + videoPlayerController!.state.completed || + (_durationInSeconds(position.value) == + _durationInSeconds(duration.value)); + // 双击播放、暂停 Future onDoubleTapCenter() async { - if (videoPlayerController!.state.completed || - (_durationInSeconds(position.value) == - _durationInSeconds(duration.value))) { + if (!isLive && _isCompleted) { await videoPlayerController!.seek(Duration.zero); videoPlayerController!.play(); } else {