-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swiping video causes video to play on ipad iOS 8.1 #1817
Comments
I can quasi-confirm this one. On both an iPad and iPhone it works fine if I scroll how I normally do, but if I shorten it to more of a quick, swiping motion then it will trigger a click event most of the time. We should probably decrease the length that's considered a swipe vs click? |
I can accept that a slow swipe be mistaken for a click, but a fast swipe being counted as click is certainly wrong. Either way why doesn't it happen after video is paused? |
Why would you expect an actual dragging motion to be mistaken for a click? I'm having to actively change how I scroll to reproduce this, but it seems like a reasonable movement so I agree that it's probably worth experimenting with a lower tap movement threshold. Want to find a lower number that works for this movement and submit a PR? Didn't notice the second question (or late edit that I missed). Looks like the video element isn't tappable on the iPad when using custom controls, so after the video is paused you actually have to hit the play button to continue playback. Initially the entire poster is a clickable element, which is what's registering that initial tap event. |
No, I can play video after it's stopped by tapping anywhere on the video on iPad, but I can't play it by swiping. This makes me wonder if the problem lies indeed in swipe logic because then swiping should continue to trigger a click after video is stopped and hence play it, same as a click does. |
Well that's strange, I'll hold off opening an issue for that, then...For whatever reason click events on the player itself aren't working for me. Our iPad for testing just died, so I'll play with that more later today. FWIW, I don't think that's related to the click / swipe confusion. A quick look around for the tap threshold in other projects shows anything from 2 (hammer.js) to 11, which even on the larger end is still half what our current tap movement threshold is. I'll test the element-click issue more later today and open a separate issue if need be. |
I don't think reducing the tap threshold is the right way to better differentiate taps from swipes. Perhaps it would be better if we take velocity also into account. This article explains the problem well: http://minuum.com/taps-and-swipes/ For example in touchend handler you can trigger tap only if velocity is less than 1 px/ms. |
I think lowering the tap threshold would improve things, but a PR taking velocity into account would certainly be welcome. |
I am hitting the same issue on iPhone iOS 8.1.2 as well. I am building a webpage with a list of videos, and scrolling through the page would inevitably open a video by accident. Unfortunately, iOS launches the video in full screen and interrupts the user's scrolling. The user has to close the full screen video and "be careful" not to scroll too fast. This makes the page very hard to use. |
There are two things that cause this issue:
I have already sent a pull request to fix point 1, #1809. |
Steve - thanks for submitting the fix for 1 and looking into 2! I am really looking forward to seeing this fixed in the next release. |
Thanks for the ping on this one, I'd been meaning to put out a PR for |
That PR was merged in, so closing. |
If I go to videojs.com and swipe video in an attempt to scroll the page the video starts playing! If I pause video and swipe again, video does not start playing. Why video plays on first swipe? How can I avoid video play during page swiping?
The text was updated successfully, but these errors were encountered: