paulirish / lite-youtube-embed

A faster youtube embed.
https://paulirish.github.io/lite-youtube-embed/
Other
5.84k stars 271 forks source link

Add aria-label to code sample with button #95

Closed davidsneighbour closed 2 years ago

davidsneighbour commented 3 years ago

Accessibility tools complain about the button not having a label for screenreaders. This adds a simple "play video" label that users can adapt to their needs.

Garbee commented 3 years ago

I think the point of the visually hidden text is to be the button's label for screen readers. Perhaps we should look into if that isn't working in some scenarios (or if the tools aren't picking it up correctly) before jumping to throwing aria around.

paulirish commented 2 years ago

We chose to go with a visually hidden text node based on a suggestion from Heydon. https://github.com/paulirish/lite-youtube-embed/issues/9#issuecomment-715876343

@davidsneighbour what a11y tools are flagging this?

davidsneighbour commented 2 years ago

I think this can be closed. The error is not coming up as of now. The tool used was AXA dev tools in Chrome. I think it might have been an issue with Javascript-inserted markup maybe.