Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Copy touch object for firstTouch #1809
I find that tap is too sensitive on mobile. Scrolling on top of video.js player often triggers tap and play the video.
On line 1063,
This makes scrolling always emits tap event, which is bad on small screen, because users may often perform touch scroll on top of video.js player.
Further, I think we should also reduce
This is what I did to validate the issue:
Actual result: xdiff, ydiff, and touchDistance values are always 0. Video starts playing.
Expected result: ydiff should be > 0, touchDistance should be > 0. Video should not start playing.
Thanks for sticking with this @steverandy. The original issue now makes sense to me. Assuming the browser doesn't create a new touch object for touches when the page X/Y changes, this would be a problem. Thanks for the fix.
As a separate issue, I think it makes sense to reduce the touch more range to 10px. The current 22px referred to half the size of a standard iOS button. At the time HammerJS was using 10px but now they're using 2px, so without knowing more myself it seem like we could at least go down to 10px.