mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +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;
|
_gestureType = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void onDoubleTapDown(TapDownDetails details) {
|
void onDoubleTapDownMobile(TapDownDetails details) {
|
||||||
if (plPlayerController.controlsLock.value) {
|
if (plPlayerController.controlsLock.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1048,13 +1048,35 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
plPlayerController.onDoubleTapCenter();
|
plPlayerController.onDoubleTapCenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onDoubleTapDesktop([_]) {
|
void onDoubleTapDesktop() {
|
||||||
if (plPlayerController.controlsLock.value) {
|
if (plPlayerController.controlsLock.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plPlayerController.triggerFullScreen(status: !isFullScreen);
|
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;
|
final isMobile = Utils.isMobile;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -1105,11 +1127,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
onInteractionEnd: _onInteractionEnd,
|
onInteractionEnd: _onInteractionEnd,
|
||||||
flipX: plPlayerController.flipX.value,
|
flipX: plPlayerController.flipX.value,
|
||||||
flipY: plPlayerController.flipY.value,
|
flipY: plPlayerController.flipY.value,
|
||||||
onTap: isMobile
|
onTap: onTap,
|
||||||
? () => plPlayerController.controls =
|
onDoubleTapDown: onDoubleTapDown,
|
||||||
!plPlayerController.showControls.value
|
|
||||||
: onTapDesktop,
|
|
||||||
onDoubleTapDown: isMobile ? onDoubleTapDown : onDoubleTapDesktop,
|
|
||||||
onLongPressStart: isLive
|
onLongPressStart: isLive
|
||||||
? null
|
? null
|
||||||
: (_) => plPlayerController.setLongPressStatus(true),
|
: (_) => plPlayerController.setLongPressStatus(true),
|
||||||
|
|||||||
@@ -1213,8 +1213,8 @@ packages:
|
|||||||
description:
|
description:
|
||||||
path: media_kit_video
|
path: media_kit_video
|
||||||
ref: "version_1.2.5"
|
ref: "version_1.2.5"
|
||||||
resolved-ref: "4d68e69281b44f2c8e3c444cca3d8d8dc6dcff88"
|
resolved-ref: ca662553c24e94a6b4bf587c7bf89196d0d54647
|
||||||
url: "https://github.com/My-Responsitories/media-kit.git"
|
url: "https://github.com/bggRGjQaUbCoE/media-kit.git"
|
||||||
source: git
|
source: git
|
||||||
version: "1.2.5"
|
version: "1.2.5"
|
||||||
menu_base:
|
menu_base:
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ dependency_overrides:
|
|||||||
ref: version_1.2.5
|
ref: version_1.2.5
|
||||||
media_kit_video:
|
media_kit_video:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/My-Responsitories/media-kit.git
|
url: https://github.com/bggRGjQaUbCoE/media-kit.git
|
||||||
path: media_kit_video
|
path: media_kit_video
|
||||||
ref: version_1.2.5
|
ref: version_1.2.5
|
||||||
media_kit_libs_video:
|
media_kit_libs_video:
|
||||||
|
|||||||
Reference in New Issue
Block a user