First pass at ARIA. Video player buttons announce themselves as button when used with a screen reader

This commit is contained in:
jmclaus
2013-09-27 19:21:43 +02:00
parent a3525875fd
commit dfe45d5bd6
5 changed files with 16 additions and 0 deletions

View File

@@ -63,6 +63,10 @@ function () {
state.videoControl.el.addClass('html5');
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)

View File

@@ -43,6 +43,9 @@ function () {
state.videoQualityControl.el.show();
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)

View File

@@ -62,6 +62,9 @@ function () {
});
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'));
}
/**

View File

@@ -79,6 +79,9 @@ function () {
});
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'));
}
/**

View File

@@ -105,6 +105,9 @@ function () {
this.videoCaption.hideCaptions(true);
this.videoCaption.hideSubtitlesEl.hide();
}
// ARIA
// Let screen readers know this anchor behaves like a button.
this.videoCaption.hideSubtitlesEl.attr('role', gettext('button'));
}
// function bindHandlers()