mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-28 21:30:18 +08:00
@@ -635,7 +635,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
Text(
|
||||
'${videoDetailController.playedTime == null
|
||||
? '立即'
|
||||
: plPlayerController!.playerStatus.isCompleted
|
||||
: plPlayerController!.isCompleted
|
||||
? '重新'
|
||||
: '继续'}播放',
|
||||
style: TextStyle(
|
||||
@@ -693,13 +693,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
: Positioned.fill(
|
||||
bottom: -2,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
onTap: () {
|
||||
if (!videoDetailController.isFileSource) {
|
||||
if (videoDetailController.isQuerying) {
|
||||
if (kDebugMode) {
|
||||
debugPrint(
|
||||
'handlePlay: querying',
|
||||
);
|
||||
debugPrint('handlePlay: querying');
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -723,21 +721,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
null) {
|
||||
handlePlay();
|
||||
} else {
|
||||
if (plPlayerController!
|
||||
.videoPlayerController!
|
||||
.state
|
||||
.completed) {
|
||||
await plPlayerController!
|
||||
.videoPlayerController!
|
||||
.seek(Duration.zero);
|
||||
plPlayerController!
|
||||
.videoPlayerController!
|
||||
.play();
|
||||
} else {
|
||||
plPlayerController!
|
||||
.videoPlayerController!
|
||||
.playOrPause();
|
||||
}
|
||||
plPlayerController!.onDoubleTapCenter();
|
||||
}
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
|
||||
@@ -1273,9 +1273,13 @@ class PlPlayerController with BlockConfigMixin {
|
||||
}
|
||||
}
|
||||
|
||||
bool get isCompleted =>
|
||||
videoPlayerController!.state.completed ||
|
||||
durationInMilliseconds - positionInMilliseconds <= 50;
|
||||
|
||||
// 双击播放、暂停
|
||||
Future<void> onDoubleTapCenter() async {
|
||||
if (!isLive && videoPlayerController!.state.completed) {
|
||||
if (!isLive && isCompleted) {
|
||||
await videoPlayerController!.seek(Duration.zero);
|
||||
videoPlayerController!.play();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user