-
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
[Mobile] Disable focus on click of Big Play Button #9006
Comments
Looks like the last relevant change (#4497) was specifically to skip changing focus for mouse events. Maybe, it should be updated to instead only change focus on keyboard events instead of skipping mouse events. |
Doing a stricter check for keyboard events is probably fine, but we'd need to confirm that it continues to function for Screen Readers. So, potentially, the easiest is to exclude touch events, unless VoiceOver on iOS, for example, uses touch events. In which case, it gets a bit trickier. May be easier to have stricter focus styles. |
After a quick peek I thought this might suffice, but it turns out the eventual event that reaches diff --git a/src/js/big-play-button.js b/src/js/big-play-button.js
index 2bc7b4a1..4cd0d799 100644
--- a/src/js/big-play-button.js
+++ b/src/js/big-play-button.js
@@ -20,6 +20,7 @@ class BigPlayButton extends Button {
this.setIcon('play');
this.on('mousedown', (e) => this.handleMouseDown(e));
+ this.on('touchstart', (e) => this.handleMouseDown(e));
}
/** video.js/src/js/big-play-button.js Lines 49 to 58 in c7298d4
There's some documentation about how to work that out here: https://developer.mozilla.org/en-US/docs/Web/API/Touch/clientX |
Checking for the "
|
Description
As default Video.js displays Big Play Button (
vjs-big-play-button
CSS class).When
vjs-big-play-button
is clicked, thevjs-play-control
is focused:2025-01-07.011304.mp4
Related:
Reproduction
https://stackblitz.com/edit/vercel-next-js-dykavrxx
Errors
No response
What version of Video.js are you using?
8.22.0
Video.js plugins used.
No response
What browser(s) including version(s) does this occur with?
Firefox 135
What OS(es) and version(s) does this occur with?
Windows 11
Solution (Draft)
On /src/js/big-play-button.js, use focus only when
'ontouchstart' in globalThis
isfalse
.The text was updated successfully, but these errors were encountered: