Commit dfe45d5b by jmclaus

First pass at ARIA. Video player buttons announce themselves as button when used…

First pass at ARIA. Video player buttons announce themselves as button when used with a screen reader
parent a3525875
...@@ -63,6 +63,10 @@ function () { ...@@ -63,6 +63,10 @@ function () {
state.videoControl.el.addClass('html5'); state.videoControl.el.addClass('html5');
state.controlHideTimeout = setTimeout(state.videoControl.hideControls, state.videoControl.fadeOutTimeout); state.controlHideTimeout = setTimeout(state.videoControl.hideControls, state.videoControl.fadeOutTimeout);
} }
// ARIA
// Let screen readers know these anchors behaves like a button.
state.videoControl.playPauseEl.attr('role', gettext('button'));
state.videoControl.fullScreenEl.attr('role', gettext('button'));
} }
// function _bindHandlers(state) // function _bindHandlers(state)
......
...@@ -43,6 +43,9 @@ function () { ...@@ -43,6 +43,9 @@ function () {
state.videoQualityControl.el.show(); state.videoQualityControl.el.show();
state.videoQualityControl.quality = null; state.videoQualityControl.quality = null;
// ARIA
// Let screen readers know this anchor behaves like a button.
state.videoQualityControl.el.attr('role', gettext('button'));
} }
// function _bindHandlers(state) // function _bindHandlers(state)
......
...@@ -62,6 +62,9 @@ function () { ...@@ -62,6 +62,9 @@ function () {
}); });
state.videoVolumeControl.el.toggleClass('muted', state.videoVolumeControl.currentVolume === 0); state.videoVolumeControl.el.toggleClass('muted', state.videoVolumeControl.currentVolume === 0);
// ARIA
// Let screen readers know this anchor behaves like a button.
state.videoVolumeControl.buttonEl.attr('role', gettext('button'));
} }
/** /**
......
...@@ -79,6 +79,9 @@ function () { ...@@ -79,6 +79,9 @@ function () {
}); });
state.videoSpeedControl.setSpeed(state.speed); state.videoSpeedControl.setSpeed(state.speed);
// ARIA
// Let screen readers know this anchor behaves like a button.
state.videoSpeedControl.el.children('a').attr('role', gettext('button'));
} }
/** /**
......
...@@ -105,6 +105,9 @@ function () { ...@@ -105,6 +105,9 @@ function () {
this.videoCaption.hideCaptions(true); this.videoCaption.hideCaptions(true);
this.videoCaption.hideSubtitlesEl.hide(); this.videoCaption.hideSubtitlesEl.hide();
} }
// ARIA
// Let screen readers know this anchor behaves like a button.
this.videoCaption.hideSubtitlesEl.attr('role', gettext('button'));
} }
// function bindHandlers() // function bindHandlers()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment