Skip to content

🎥 Make videos programmatically with React

feat: update player/double-click

jkcsf7d0d0f0b118
diff --git a/packages/docs/docs/player/api.md b/packages/docs/docs/player/api.md
index 53de2744f1..2c85aef114 100644
--- a/packages/docs/docs/player/api.md
+++ b/packages/docs/docs/player/api.md
@@ -108,6 +108,10 @@ _optional_
A boolean property defining whether you can go fullscreen and exit fullscreen in the video with double click into the player. If enabled, clicking on the video once will delay pausing the video for 200ms to wait for a possible second click. Default `false`.
+:::note
+This option is not supported on mobile. You do not double-tap on mobile to go to fullscreen.
+:::
+
### `spaceKeyToPlayOrPause`
_optional_
diff --git a/packages/player/src/utils/use-click-prevention-on-double-click.ts b/packages/player/src/utils/use-click-prevention-on-double-click.ts
index e1594629fe..641ef6f50e 100644
--- a/packages/player/src/utils/use-click-prevention-on-double-click.ts
+++ b/packages/player/src/utils/use-click-prevention-on-double-click.ts
@@ -13,6 +13,12 @@ const useClickPreventionOnDoubleClick = (
const handleClick = useCallback(
async (e: SyntheticEvent) => {
+ // UnSupported double click on touch.(mobile)
+ if ((e.nativeEvent as PointerEvent).pointerType === 'touch') {
+ onClick(e);
+ return;
+ }
+
api.clearPendingPromises();
const waitForClick = cancellablePromise(delay(200));
api.appendPendingPromise(waitForClick);