Skip to content

fix(video): restore tap-to-pause on React video players - #1754

Draft
kduncanhsu wants to merge 1 commit into
box:masterfrom
kduncanhsu:fix/react-video-tap-to-pause
Draft

fix(video): restore tap-to-pause on React video players#1754
kduncanhsu wants to merge 1 commit into
box:masterfrom
kduncanhsu:fix/react-video-tap-to-pause

Conversation

@kduncanhsu

Copy link
Copy Markdown
Collaborator

Summary

  • On touch devices, tapping the video never paused playback for React v1 and v2 controls. touchstart prevented the click that toggles play, then only toggled the legacy control bar (mediaControls), which React players do not create.
  • Legacy (non-React) controls are unchanged: a tap still shows/hides the bar, which always includes play/pause.
  • React players now toggle play/pause on tap, matching desktop click behavior, and still let the control bar show.

Test plan

  • Play a video with React v1 controls (useReactControls, videoPlayerV2.enabled off) on a phone or DevTools mobile viewport and tap the video to pause/play
  • Repeat with React v2 (videoPlayerV2.enabled on)
  • Repeat on a narrow desktop window (< 580px)
  • Confirm legacy (non-React) controls still show/hide the bar on tap rather than toggling playback
  • Confirm a mouse click on the video still toggles play/pause on desktop

Made with Cursor

Touch events were swallowed for React v1/v2, so mobile users could not pause by tapping the video.

Co-authored-by: Cursor <cursoragent@cursor.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Duncan Hsu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants