mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt video gesture
Closes #1374 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user