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