-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Correcting NativeControls + Taps. #3873
Conversation
So, the issue is that on mobile if you're using native controls, our tap emitter causes issues when applied to the "tech" itself. Maybe the This way, we can make this PR a more precise and minimal change targeting the issue at hand. If something like |
That could possibly solve our issue with native controls not showing on taps. Let me do some playing and I'll get back to this PR. Thanks for your input! :D I did originally want to wrap in an option in case people were previously expecting this behaviour. |
If using nativeControlsForTouch, skip the emitTapEvents listeners from being setup. This avoids taps being taken away from native video elements and stopping controls being displayed.
afa7421
to
b74c08c
Compare
Updated the branch, now simply skipping Tested with our current usage of VideoJS, desktop-chrome, iOS Safari and Android Chrome. All working nicely. Thanks for the suggestion for the simpler solution. |
Oh, cool. This is even simpler. Is the other piece no longer necessary? |
It's not required for showing controls on tap, no. That may have had something to do with scrolling past the video player. However for the purposes of this PR, I'm going to ignore it and open a separate PR if that mousemove capture/stop causes issues around the scroll. |
Sounds good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
Skipping browser bugfix for changing cursor as that stops tap events
from propagating to native controls. Also enabled option that disables
converting events to 'tap'. The 'tap' event does not cause native
controls to appear on devices like android.
Description
When using nativeControlsForTouch - taps appear to be stalled and don't go through to the native video element, therefore the controls never appear again when tapping as would be expected. On Android you have to tap and hold to bring up the controls, which is not as users would typically expect.
Additionally, added option for disableEmitTapEvents which when enabled, doesn't attempt to convert / check taps and allows the browser to natively interpret taps as clicks instead.
Specific Changes proposed
Added option disableEmitTapEvents to stop converting taps to manually.
Don't call stopPropagation and preventDefault on mousemove when TOUCH_ENABLED is true and we're using nativeControls.
This particular change has been in production for us for a while now as we rely on native controls for touch users.