diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index 9dac81bb7..e2cff1e9b 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -1020,7 +1020,7 @@ class _PLVideoPlayerState extends State _gestureType = null; } - void onDoubleTapDown(TapDownDetails details) { + void onDoubleTapDownMobile(TapDownDetails details) { if (plPlayerController.controlsLock.value) { return; } @@ -1048,13 +1048,35 @@ class _PLVideoPlayerState extends State 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 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), diff --git a/pubspec.lock b/pubspec.lock index 3808faddb..b6c628fe3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: diff --git a/pubspec.yaml b/pubspec.yaml index 4e74a1336..4ebe14faf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: