-
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
Configurable title attribute strings for player controls to improve accessibility #6767
Comments
👋 Thanks for opening your first issue here! 👋 If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
… in the UI (fixes videojs#6767).
@drewlee can you take a look at this quick prototype, and see if just providing an option to prevent the title attribute from being set by UI components does what you need? https://github.com/OwenEdwards/video.js/tree/feat/add-noUITitleAttributes-option Specifically, if you do Or do you need a more broad "ability to customize/override [...] control strings" as title attributes, as well as just to prevent them? |
@OwenEdwards thanks for setting this up. Looking at the demo, I think this would definitely meet our needs. |
…ibutes in the UI (videojs#7134) Fixes videojs#6767
Description
The current means of configuring player control strings assigns the same string for both the button's name and its
title
attribute. While this behavior is well-intentioned, it is ultimately harmful for accessibility. As background, the general purpose of thetitle
attribute is to provide supplementary information to help clarify or further describe the purpose of a control. Simply duplicating a control's existing string label is misuse, and results in redundant output when using screen reading software.As noted in the HTML specification under https://html.spec.whatwg.org/multipage/dom.html#the-title-attribute:
While it is common practice to utilize the
title
attribute to display native tooltips, this in itself is also problematic. For one, native browser tooltips only render while utilizing a pointer device and are thus completely inaccessible to keyboard-only users. Behavior is also inconsistent between various browser implementations. In this case, a custom accessible tooltip is a much better approach. There are several other points discussed under https://www.24a11y.com/2017/the-trials-and-tribulations-of-the-title-attribute/ that dissuade its use.For these stated reasons, I propose providing the ability to customize/override and prevent control strings from being automatically applied to their respective
title
attributes. This can likely be accomplished in backward compatible means so that existing implementations aren't affected.Our organization discourages and is in the process of replacing similar patterns of redundant
title
s. However, this is something we are blocked on with our media players which utilize video.js and is also observed on BigPlayButton. We also leverage custom accessible tooltips which ultimately render the button titles unnecessary, but have no straight forward means of preventing them from rendering.The text was updated successfully, but these errors were encountered: