pnc是什么意思| miko是什么意思| 移花接木的意思是什么| 补血补气吃什么好| 什么的高山填空| 什么少年| wtf是什么意思| 诏安是什么意思| 什么民族不吃猪肉| 10月14日什么星座| 荷叶和什么搭配最减肥| 处心积虑是什么意思| 出淤泥而不染是什么花| 朱砂痣是什么意思| 侵犯是什么意思| 生理期吃什么水果比较好| 4月23日什么星座| 阳痿早泄吃什么药| 婴儿湿疹用什么| 禁忌症是什么意思| 空五行属什么| 咳嗽吃什么水果最好| 处女男和什么星座最配| 大宝是什么意思| 六安瓜片是什么茶| 吹泡泡是什么意思| 孩子拉肚子吃什么药| lime是什么颜色| 枸杞子有什么功效| 前列腺增生用什么药| 抗0是什么意思| 锻炼pc肌有什么好处| 男性全身皮肤瘙痒是什么原因| 为什么摩羯女颜值都高| 吃什么可以补铁| 米娜桑是什么意思| 小猫什么时候打疫苗| 什么的青草| 什么是性上瘾| 物以类聚人以群分什么意思| 副脾对身体有什么影响| 眼睑是什么意思| 只是当时已惘然是什么意思| 老年人贫血吃什么补血最快最有效| 苦肠是什么部位| 男性生殖痒是什么原因| 补钙吃什么维生素| 白矾是什么东西| 一只眼睛肿了是什么原因| 左肖是什么生肖| 卸磨杀驴是什么意思| 包装饮用水是什么水| 大学生当兵有什么好处| 雌二醇高有什么症状| 斑鸠吃什么食物| 波折是什么意思| 失眠吃什么食物| 农历5月20日是什么星座| 前列腺增生是什么原因引起的| 北芪煲汤加什么药材好| 生物学父亲是什么意思| 什么是九宫格| 乏力没精神容易疲劳是什么原因| 红色尿液是什么原因| 痛点是什么意思| b3维生素又叫什么| 处变不惊是什么意思| 左边脸长痘痘是什么原因| pd是什么病| 甲胎蛋白是什么| 猪脚煲汤放什么材料好| 肩胛骨疼挂什么科| 肆无忌惮的意思是什么| 就让我爱你把你捧在手心里是什么歌| 吃什么补肾壮阳最快| 葡萄胎有什么症状反应| 阴道有异味买什么药| 1月25号什么星座| 波罗蜜多什么意思| 皮损是什么意思| 8朵玫瑰花代表什么意思| 缺钙会出现什么症状| 决心是什么意思| 什么猪没有嘴| 牛黄安宫丸什么时候吃最好| 盆腔炎做什么检查能查出来| 黄体可能是什么意思啊| 风湿是什么原因造成的| 速度是70迈心情是自由自在什么歌| 2.22是什么星座| 殉葬是什么意思| 脚上起水泡用什么药膏| 1月1号什么星座| 手突然抽搐是什么原因| 地笼捕河虾用什么诱饵| 抗hp治疗是什么意思| 电解质是什么| 一失足成千古恨是什么意思| 什么火海| 干咳喝什么止咳糖浆好| oc是什么意思| erdos是什么牌子| 六六无穷是什么意思| 醒酒汤是什么| 黑醋是什么醋| 麦乳精是什么东西| 殿试是什么意思| 提心吊胆是什么生肖| 墨龟为什么只能养一只| 格力空调睡眠模式1234什么意思| 喝枸杞有什么好处| 已知晓是什么意思| 半熟芝士是什么意思| 喝红茶有什么好处和坏处| 超声介入是什么意思| 95年的猪是什么命| 儿童水痘吃什么药| 琉璃和玻璃有什么区别| 色弱是什么| 什么叫理疗| 下眼睑肿胀是什么原因| 一什么见什么| 为什么新疆人长得像外国人| 怀孕10多天有什么症状| 香砂六君丸治什么病| 为什么回族不吃猪肉| 中国四大发明是什么| 检查痛风挂什么科| 脚面麻木是什么原因| 宫颈炎用什么药物治疗比较好| 无证之罪什么意思| 肺气不足吃什么食物可以补肺气| 眼睛发热是什么原因| 泡打粉是什么东西| 枸杞和什么搭配壮阳| 煤气罐为什么会爆炸| 肚子胀什么原因| 周角是什么| 体重什么时候称最准确| 抑郁症是什么意思| 碧玉五行属什么| 牙龈老是出血是什么原因引起的| 反映是什么意思| 遗尿是什么症状| 孕妇吃什么能马上通便| 阿胶配什么吃不上火| 金兰之交是什么意思| 勇敢的什么| 三月二十八号是什么星座| 牙齿出血是什么病| 白化病是什么原因引起的| 实性结节什么意思| 腰间盘突出压迫神经什么症状| 猫咪来家里是什么寓意| 端午节干什么| 新生儿黄疸高有什么风险| 小便短赤是什么意思| 败血症吃什么药| 什么是党的根本大法| 偏头痛吃什么药效果好| 突然长胖很多是什么原因| 大阪烧是什么| 比宇宙还大的是什么| 刚愎自用是什么意思| 新加坡什么工作最挣钱| 一什么牛| 现在有什么赚钱的路子| 蜂蜜的主要成分是什么| hr阳性是什么意思| 红楼梦主要讲了什么| 三个女人一台戏什么意思| 干巴得是什么意思| 感性什么意思| 女生喝什么茶对身体好| 孔子原名叫什么| 嗓子痒痒老想咳嗽是什么原因| 脱发是什么病| 吃洋葱有什么好处| 夏季吃什么水果| 醋精和白醋有什么区别| omega3是什么意思| 紫外线过敏用什么药膏| 嘿嘿嘿是什么意思| 金黄的稻田像什么| 3月11日什么星座| 汉语什么意思| 眼睛干涩用什么眼药水| hp-是什么意思| 经辐照是什么意思| 心血管堵塞吃什么好| 半月板是什么| 柚子什么时候成熟| 四月二十一是什么星座| 胃窦溃疡a1期是什么意思| 潴是什么意思| co是什么气体| dfi是什么意思| 格色是什么意思| 什么是寒性食物| 血压偏低是什么原因| 梦见打人是什么意思| spyder是什么品牌| 机体是什么意思| 什么是特异性皮炎| 脱式计算是什么意思| 六根清净是什么意思| 聚宝盆是什么意思| 脚癣是什么原因引起的| 左撇子是什么意思| 手麻是什么病的预兆| 疱疹性咽峡炎是什么引起的| 分母是什么意思| 尿道炎症吃什么药| 吃什么不会便秘| 铁子是什么意思| 中书舍人是什么官职| 有龙则灵的灵是什么意思| 老戏骨是什么意思| 扒拉是什么意思| 头皮发麻是什么病的前兆| 辗转反侧什么意思| 水红色是什么颜色| 纯天然无公害什么意思| 杰字五行属什么| 喜欢紫色代表什么| 福星是什么意思| 孕妇d2聚体高是什么原因| 怀孕养狗对胎儿有什么影响| 种植什么药材最赚钱| 梦见蛇被别人打死是什么兆头| 左耳朵痒代表什么预兆| 什么的水| 金牛座女和什么座最配对| neg是什么意思| 一什么傍晚| 来月经前胸胀痛什么原因| 牙龈疼是什么原因| icu什么意思| 参片泡水喝有什么功效| 什么生机| ats是什么意思| 蛋白粉什么牌子好| 啪啪啪什么感觉| 梦见情人是什么意思啊| 高数是什么| 请什么自什么| 鹦鹉吃什么蔬菜| 正品是什么意思| 满是什么结构| 脚为什么会肿| 皮肤过敏擦什么药膏好得快| 什么避孕套好用| 八爪鱼是什么| 脚跟痛什么原因| 做梦踩到屎是什么意思| 肺看什么科室| 喉咙有痰吐出来有血是什么原因| 弦是什么| panerai是什么牌子| 单核细胞偏低是什么意思| 燕窝有什么营养价值| 1999年出生的属什么| 怀不上孕是什么原因造成的| 什么花走着开| 百度

《习近平关于全面依法治国论述摘编》

Video.js Blog

Brandon Casey2025-08-05

Feature Spotlight: Accessibility

Accessibility! The most important feature you never knew about.

In the Video.js organization we try hard to have good accessibility. Like most other software, any change can affect the system in unintended ways. For example MuteToggle and VolumeControl were married into VolumeMenuButton in Video.js 5. While this change did allow these controls to work in tandem visually, it also did something unintended. It broke accessibility. In this post we will go over what broke, what the fix was, what accessibility is, and how to test and make sure it works.

Feel free to skip to the last section if you already know what accessibility is.

Accessibility? What's that?

Accessible software has support for users with vision, hearing, movement/dexterity, or other impairments. It also helps users that want to use the keyboard to navigate. Out of the box web applications have some accessibility due to the nature of HTML, but this is only the case if you are using native elements in intended ways. If you cannot use native DOM elements, like <button>, and instead must use a <div> for buttons, then you need worry about accessibility in your page.

Supporting users with hearing impairment is not something that we can do directly for the users of Video.js. Instead we must indirectly support these users by adding support for captions in videos. In Video.js we have had support for captions and subtitles for some time, internally they are called TextTracks. In fact Video.js has had support for WebVTT format TextTrack, which is much more accessible, since version 4.

Supporting users with vision impairment is harder, but partly in our control. To support this group of users our player must be accessible to screen readers. A screen reader is an application that reads elements off of the screen to the user (as the name implies). On top of reading from the screen it also allows the user to interact with the page using only the keyboard or specific gestures on a touchscreen (without using a mouse or needing to directly touch visible items). HTML has certain rules that must be followed so that a page can be accessible. We will go over the basics of these rules in the next section. Screen readers are further supported by having description tracks that can be read out during video playback. Description tracks are a sub-type of TextTrack, and as previously stated we cannot automatically add them to videos, we can only have support for them in the Video.js.

See the resources section at the end of this post for a list of screen readers.

How do you make a web application screen reader accessible?

If you use the native elements for the purposes that they were intended, you will already have most of the work done.This is why the use of the native element is the recommended way to make anything accessible for a screen reader. For instance if you use a <button> element you will get the following accessibility attributes (without them actually being on the button):

  • tabIndex which allows users to tab to the button
  • role="button" which tells the screen reader that this is a button
  • The space and the enter key will both press the button

In some cases, such as in Video.js, it will not be possible to use the native <button> element. You will have to mimic the accessible functionality from the list above and use a div. Here is a list of what you will have to add:

  • You have to add the role="button" attribute to classify it as a button.
  • You have to add a tabIndex which will allow the div to be navigated to using the tab key
  • You have to add handling for the space and enter key that press the button

A list of role attribute values can be found on Mozilla Developer Network.

After mimicking or adding native accessibility on the controls and content in your webpage, the next thing to look over are aria attributes. For instance, we use aria-live="polite" for our ProgressBar slider. By default aria-live is set off, which means updates to controls should not be read to the user unless they un-focus and re-focus an element. The value of polite which we use allows us to convey the position of the slider to screen reader without them having to change focus on the control. This is useful because the ProgressBar is always updating while a video is playing. A value of polite will also wait to convey said updates until the screen reader is done reading other information to the user.

For a more complete list of ARIA attributes see the specification.

Finally you need to add an accessible "name" to an element so that it can be referred to. A good example of this is can be seen in the MuteToggle control. Since it is not a simple "button" we include innerHTML/innerText of "Mute" or "Unmute" in a way that is hidden from most users but announced to screen readers. In Video.js we refer to the accessible name and the action that a control performs as "control text". Control text also updates the title attribute of an element in most cases, which is important for visual accessibility. When the action the a control performs changes so does the control text. This will allow the screen reader to refer to the MuteToggle as "Mute Toggle" rather than "button". It will also convey the current action of the MuteToggle. In this case that will be either "Mute" or "Unmute" depending on what the button would do when pressed (ie the state of the button).

Here are some examples of accessibility straight from Video.js:

  • The MuteToggle <button>:
    • Has aria-live set to polite, rather than the default value of off. aria-live with any value other than off indicates that innerText/innerHTML updates can be sent to the screen reader without the user needing to move focus off of the control. The value of polite means that the screen reader should wait until it is done speaking to convey these updates to the user.
    • Has control text of "Mute" or "Unmute" which indicates the current status of the button to the use
  • The VolumeBar slider <div>:
    • Has a role attribute with a value of slider. Like this: role="slider"
    • Has a tabIndex attribute as it is not a native control element
    • Has EventHandlers that listen for:
      • The up and right arrow keys to increase the volume and the slider percentage
      • The down and left arrow keys to decrease the volume and the slider percentage
    • Has aria-label of "volume level" which is an accessible label that the screen reader will use to refer to it
    • Has aria-valuenow and aria-valuetext properties that update to indicate the current volume level (so the screen reader can read it)
    • Has aria-live set to polite, rather than the default value of off. aria-live with any value other than off indicates that innerText/innerHTML updates can be sent to the screen reader without the user needing to move focus off of the control. The value of polite means that the screen reader should wait until it is done speaking to convey these updates to the user.

The problem and the solution

Now let's talk about how screen reader accessibility broke in Video.js 5. First VolumeMenuButton replaced MuteToggle and VolumeControl on the ControlBar. VolumeMenuButton was set to mimic MuteToggle when clicked. It would also show the VolumeControl on mouseover or focus. This was a problem because a VolumeControl was a now a child of a button, and buttons should not contain other controls. To the screen reader and to the DOM there are two MuteToggle button controls. When visually there is a VolumeControl and a MuteToggle. Below you can see a gif of this behavior in action :

macOS `VoiceOver` Before The FixmacOS `VoiceOver` Before The Fix

The solution to this problem was to use a regular div to house the MuteToggle and VolumeControl. This regular div would have no role or control text so that it would be invisible to a screen reader. From that point forward we just needed to mimic the old UI. For those who are wondering, this new Component is called the VolumePanel. See the new behavior in a gif below:

macOS `VoiceOver` After The FixmacOS `VoiceOver` After The Fix

Outlines

Another big accessibility fix for controls comes from the removal of one small css rule:

outline: none;

Why did we do it? With feedback from the community and external resources, we learned that outlines should always be on. Without outlines there is no visual indication of keyboard focus on control elements and without that, keyboard users who are not visually impaired have a hard time using the controls.

Wrap up

Hopefully this post has given you some insight into making a web application accessible. If you find any issues or have any suggestions for our accessibility or in general feel free to contribute to Video.js.

If you want to keep up to date on the current state of accessibility work see the a11y label on PRs and issues.

Resources

Here are some popular screen readers that are actually used in the wild:

Resources for learning more about web accessibility:

梦见自己爬山是什么意思 女人适合喝什么茶最好 黄体酮吃了有什么副作用 汗蒸有什么好处和功效 北瓜是什么
为什么超市大米不生虫 终身为国是什么生肖 寡情是什么意思 什么的大象 esrd医学上是什么意思
一月出生是什么星座 菩提子手串有什么好处 止咳吃什么药 吃什么可以降胆固醇 天蝎座男生喜欢什么样的女生
读书的意义是什么 骑木驴是什么意思 什么是伪娘 工装裤搭配什么鞋子 口扫是什么
伏特加是用什么酿造的hcv9jop4ns1r.cn 皮肤经常痒是什么原因hcv8jop2ns0r.cn 疯狂动物城狐狸叫什么hcv8jop6ns8r.cn 血管瘤是什么hcv8jop1ns4r.cn 白狗子是什么意思hcv8jop6ns4r.cn
尿发黄是什么原因hanqikai.com 梦见喝酒是什么意思cj623037.com 红细胞计数偏高是什么意思hcv8jop9ns7r.cn 什么叫强直性脊柱炎chuanglingweilai.com 大便干燥吃什么jasonfriends.com
跑单是什么意思啊hcv7jop5ns6r.cn 辛巳五行属什么hcv9jop3ns0r.cn 什么食物不能一起吃hcv8jop5ns1r.cn 八一建军节什么生肖hcv8jop7ns0r.cn 牙痛 吃什么药hcv8jop9ns6r.cn
血液科是看什么病hcv9jop2ns0r.cn 灻是什么意思hcv9jop4ns0r.cn 泥腿子是什么意思huizhijixie.com 闲暇的意思是什么hcv9jop7ns3r.cn 炖排骨什么时候放盐最好aiwuzhiyu.com
百度