First pass at ARIA. Video player buttons announce themselves as button when used with a screen reader
This commit is contained in:
@@ -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 () {
|
|||||||
|
|
||||||
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 () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
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 () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
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 () {
|
|||||||
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()
|
||||||
|
|||||||
Reference in New Issue
Block a user