Skip to content
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

Video.js aria labelledby and ids contain spaces #4688

Closed
Hannah-goodridge opened this issue Oct 25, 2017 · 9 comments
Closed

Video.js aria labelledby and ids contain spaces #4688

Hannah-goodridge opened this issue Oct 25, 2017 · 9 comments
Labels
a11y This item might affect the accessibility of the player

Comments

@Hannah-goodridge
Copy link

Hannah-goodridge commented Oct 25, 2017

Description

There's seems to be odd spaces between aria labels in the video-js outputted markup inside the vjs track setting components.

Steps to reproduce

I've created a codepen in which demonstrates this issue
https://codepen.io/HannahG/pen/xXovgx

Annoyingly it's in an iframe but if you do a search for "captions-font-size-video_component_373" in dev tools you can see the issue. You get the below:
aria-labelledby=" captions-font-size-video_component_373"

This is an issue with the current build 6.2.8 and fails accessibility on the aria-labels.

Is there anything we can do to fix this?

Additional Information

We are using this for a government digital service and need AAA Accessibility if possible.

versions

videojs

6.2.8

browsers

Chrome Version 61.0.3163.100 (Official Build) (64-bit)

OSes

Windows

plugins

none

@gkatsev
Copy link
Member

gkatsev commented Oct 25, 2017

I've not seen this as an issue on OSX with voice over. Is any particular screen reader having issues with that extra space? But yes, we should definitely fix it if it's causing issues.

I can see in the code we're trying to set the aria-labelledby to be multiple things and if one doesn't exist there will be a preceding space, so, we could probably trim that.

@Hannah-goodridge
Copy link
Author

@gkatsev Thanks for taking a look at this issue.
We use the wave accessibility tool seen here
which flags these issues as errors.
Anything you could to fix would be great :)

@knilob
Copy link
Contributor

knilob commented Oct 31, 2017

I also noticed some issues with this while doing some accessibility checks for the university where i work. I think I have a quick and easy fix I can submit to alleviate this issue. It looks like the legendId variable gets initialized in following methods:

createElFgColor_()
createElBgColor_()
createElWinColor_()

However, there's no legendId initialized for the createElFont_() method. It seems like adding a check for the legendId value in the createElSelect_() method where the aria-labelledby gets set on the select and the option tags should alleviate this issue.

I've added this to my local fork, but I can't get the tests or build to actually complete at the moment to submit a PR on this.

@knilob
Copy link
Contributor

knilob commented Oct 31, 2017

Disregard my comment about not being able to run the tests or the build. It turns out I just needed to pull the updates from upstream. I should have PR for this in a bit. Feel free to let me know if I totally botched something up.

knilob added a commit to knilob/video.js that referenced this issue Oct 31, 2017
The aria-labelledby attribute on the fontPercent, edgeStyle, and
fontFamily select options inlcudes an extra space since there is
no ledgendId variable being set on the createElFont_() method. This
fix adds a check to see if the legendId value is set or not inside
the createElSelect_() method. This should keep the extra space
from appearing on the select tags created by the createElFont_()
method.

Fixes videojs#4688
@gkatsev
Copy link
Member

gkatsev commented Oct 31, 2017

Thanks @knilob. Hopefully, that's enough to fix this. I hope to have a release out this week.

@gkatsev
Copy link
Member

gkatsev commented Nov 1, 2017

actually, going to re-open this issue based on the discussion in #4708 so that we don't forget to fix that.

issue comment

looks like we have a bug in the generation of the aria-labelledby for the font families since the values themselves have spaces when we create the idea for it, it ends up messing up. For example, we end up with an id captions-font-family-vid1_component_423-Proportional Sans-Serif instead of something like captions-font-family-vid1_component_423-Proportional-Sans-Serif and then when we reference it it's wrong.

issue comment

trim() is probably better and now that I noticed we need a slightly better refactor, we probably should switch to that

@gkatsev gkatsev reopened this Nov 1, 2017
@gkatsev gkatsev added the a11y This item might affect the accessibility of the player label Nov 1, 2017
@gkatsev gkatsev changed the title Video.js aria label errors 6.2.8 Video.js aria labelledby and ids contain spaces Jan 22, 2018
@gkatsev
Copy link
Member

gkatsev commented Jan 22, 2018

Also, see #4884 for a description of the id having a space in it when it shouldn't have.

OwenEdwards added a commit to OwenEdwards/video.js that referenced this issue May 8, 2018
gkatsev pushed a commit that referenced this issue May 11, 2018
@jcbreel
Copy link

jcbreel commented May 16, 2018

This seems to be an issue still.

https://monosnap.com/file/7ktqePRZb04kkqLVyukAiNhWeyOKYw

@OwenEdwards
Copy link
Member

@jcbreel see #5167 (comment)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This item might affect the accessibility of the player
Projects
None yet
Development

No branches or pull requests

5 participants