Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-04 10:58:37 +08:00
parent 4973176868
commit aba9493ae0

View File

@@ -1432,10 +1432,21 @@ class PlPlayerController {
}
}
int _durationInSeconds(Duration duration) {
return (duration.inMilliseconds / 1000).round();
}
// 双击播放、暂停
Future<void> onDoubleTapCenter() async {
if (videoPlayerController!.state.completed ||
(_durationInSeconds(position.value) ==
_durationInSeconds(duration.value))) {
await videoPlayerController!.seek(Duration.zero);
videoPlayerController!.play();
} else {
videoPlayerController!.playOrPause();
}
}
final RxBool mountSeekBackwardButton = false.obs;
final RxBool mountSeekForwardButton = false.obs;