Skip to content

More responsive player gestures on mobile #3554

@JonnyBurger

Description

@JonnyBurger

We have a logic that when clicking on the Player, we wait 200 milliseconds to see if another click is coming.

If another click is happening, we trigger fullscreen. If no other click is happening, we play/pause the video.

I find that this pattern does not apply to mobile. You do not double-tap on mobile to go to fullscreen.

The current logic is here:

const [handleClick, handleDoubleClick] = useClickPreventionOnDoubleClick(
onSingleClick,
onDoubleClick,
doubleClickToFullscreen,
);

New logic

  • Keep the same logic on desktop
  • On mobile, if tapping the Player, it should reveal the controls immediately (this might already work!)
  • You can use https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType to check if a mouse or tap was used.
  • Don't wait for double tap
  • Update the documentation for doubleClickToFullscreen to say that it does not apply on mobile.

💎 This issue has a bounty on it!

Read our contributing guidelines:

/bounty 100

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions