1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-27 11:22:06 +02:00

fix: aria-live="assertive" only for descriptions

This changes aria-live on the text track display so it's off unless a
descriptions track is enabled.

Fixes #3554
This commit is contained in:
Owen Edwards 2016-08-25 21:06:51 -07:00 committed by Gary Katsevman
parent 202da2d468
commit 685404d018

View File

@ -145,7 +145,7 @@ class TextTrackDisplay extends Component {
return super.createEl('div', {
className: 'vjs-text-track-display'
}, {
'aria-live': 'assertive',
'aria-live': 'off',
'aria-atomic': 'true'
});
}
@ -197,8 +197,14 @@ class TextTrackDisplay extends Component {
}
if (captionsSubtitlesTrack) {
if (this.getAttribute('aria-live') !== 'off') {
this.setAttribute('aria-live', 'off');
}
this.updateForTrack(captionsSubtitlesTrack);
} else if (descriptionsTrack) {
if (this.getAttribute('aria-live') !== 'assertive') {
this.setAttribute('aria-live', 'assertive');
}
this.updateForTrack(descriptionsTrack);
}
}