Skip to content

Commit

Permalink
fix: aria-live="assertive" only for descriptions
Browse files Browse the repository at this point in the history
This changes aria-live on the text track display so it's off unless a
descriptions track is enabled.

Fixes #3554
  • Loading branch information
OwenEdwards authored and gkatsev committed Nov 3, 2016
1 parent 202da2d commit 685404d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/js/tracks/text-track-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
}
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 685404d

Please sign in to comment.