opt video gesture

Closes #1374

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-29 15:41:44 +08:00
parent 05636b33c0
commit 1d723b704b
3 changed files with 29 additions and 10 deletions

View File

@@ -1020,7 +1020,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
_gestureType = null;
}
void onDoubleTapDown(TapDownDetails details) {
void onDoubleTapDownMobile(TapDownDetails details) {
if (plPlayerController.controlsLock.value) {
return;
}
@@ -1048,13 +1048,35 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
plPlayerController.onDoubleTapCenter();
}
void onDoubleTapDesktop([_]) {
void onDoubleTapDesktop() {
if (plPlayerController.controlsLock.value) {
return;
}
plPlayerController.triggerFullScreen(status: !isFullScreen);
}
void onTap(PointerDeviceKind? kind) {
switch (kind) {
case ui.PointerDeviceKind.mouse:
onTapDesktop();
break;
default:
plPlayerController.controls = !plPlayerController.showControls.value;
break;
}
}
void onDoubleTapDown(TapDownDetails details) {
switch (details.kind) {
case ui.PointerDeviceKind.mouse:
onDoubleTapDesktop();
break;
default:
onDoubleTapDownMobile(details);
break;
}
}
final isMobile = Utils.isMobile;
@override
@@ -1105,11 +1127,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
onInteractionEnd: _onInteractionEnd,
flipX: plPlayerController.flipX.value,
flipY: plPlayerController.flipY.value,
onTap: isMobile
? () => plPlayerController.controls =
!plPlayerController.showControls.value
: onTapDesktop,
onDoubleTapDown: isMobile ? onDoubleTapDown : onDoubleTapDesktop,
onTap: onTap,
onDoubleTapDown: onDoubleTapDown,
onLongPressStart: isLive
? null
: (_) => plPlayerController.setLongPressStatus(true),

View File

@@ -1213,8 +1213,8 @@ packages:
description:
path: media_kit_video
ref: "version_1.2.5"
resolved-ref: "4d68e69281b44f2c8e3c444cca3d8d8dc6dcff88"
url: "https://github.com/My-Responsitories/media-kit.git"
resolved-ref: ca662553c24e94a6b4bf587c7bf89196d0d54647
url: "https://github.com/bggRGjQaUbCoE/media-kit.git"
source: git
version: "1.2.5"
menu_base:

View File

@@ -245,7 +245,7 @@ dependency_overrides:
ref: version_1.2.5
media_kit_video:
git:
url: https://github.com/My-Responsitories/media-kit.git
url: https://github.com/bggRGjQaUbCoE/media-kit.git
path: media_kit_video
ref: version_1.2.5
media_kit_libs_video: