Added more explanatory states to the Volume, Fullscreen, HD, and CC controls
This commit is contained in:
@@ -71,12 +71,12 @@ function () {
|
||||
// 'Fill screen' (the title attribute is set in video.html template).
|
||||
state.videoControl.playPauseEl.attr({
|
||||
'role': gettext('button'),
|
||||
'aria-disabled': 'false'
|
||||
'aria-disabled': false
|
||||
});
|
||||
|
||||
state.videoControl.fullScreenEl.attr({
|
||||
'role': gettext('button'),
|
||||
'aria-disabled': 'false'
|
||||
'aria-disabled': false
|
||||
});
|
||||
|
||||
// This anchor behaves as a slider named 'video slider'.
|
||||
@@ -189,12 +189,14 @@ function () {
|
||||
this.videoControl.fullScreenState = false;
|
||||
fullScreenClassNameEl.removeClass('video-fullscreen');
|
||||
this.isFullScreen = false;
|
||||
this.videoControl.fullScreenEl.attr('title', gettext('Fullscreen'));
|
||||
this.videoControl.fullScreenEl.attr('title', gettext('Fill browser'));
|
||||
this.videoControl.fullScreenEl.text(gettext('Fill browser'));
|
||||
} else {
|
||||
this.videoControl.fullScreenState = true;
|
||||
fullScreenClassNameEl.addClass('video-fullscreen');
|
||||
this.isFullScreen = true;
|
||||
this.videoControl.fullScreenEl.attr('title', gettext('Exit fullscreen'));
|
||||
this.videoControl.fullScreenEl.text(gettext('Exit fullscreen'));
|
||||
}
|
||||
|
||||
this.trigger('videoCaption.resize', null);
|
||||
|
||||
@@ -51,7 +51,7 @@ function () {
|
||||
// (the title attribute is set in video.html template).
|
||||
state.videoQualityControl.el.attr({
|
||||
'role': gettext('button'),
|
||||
'aria-disabled': 'false'
|
||||
'aria-disabled': false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ function () {
|
||||
state.videoProgressSlider.handle.attr({
|
||||
'role': gettext('slider'),
|
||||
'title': 'video position',
|
||||
'aria-disabled': 'false',
|
||||
'aria-disabled': false,
|
||||
'aria-valuetext': getTimeDescription(state.videoProgressSlider.slider.slider('option', 'value'))
|
||||
});
|
||||
}
|
||||
@@ -120,6 +120,7 @@ function () {
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a string describing the current time of video in hh:mm:ss format.
|
||||
function getTimeDescription(time) {
|
||||
var seconds = Math.floor(time),
|
||||
minutes = Math.floor(seconds / 60),
|
||||
|
||||
@@ -68,12 +68,12 @@ function () {
|
||||
|
||||
// This anchor behaves as a button named 'Volume'.
|
||||
// (the title attribute is set in video.html template).
|
||||
var buttonStr = state.videoVolumeControl.currentVolume === 0 ? gettext('Volume muted') : gettext('Volume');
|
||||
state.videoVolumeControl.buttonEl.attr({
|
||||
'role': gettext('button'),
|
||||
'aria-label': gettext('Volume'), // Doesn't read the title attribute, why?
|
||||
'aria-disabled': 'false'
|
||||
'aria-label': buttonStr, // Doesn't read the title attribute, why?
|
||||
'aria-disabled': false
|
||||
});
|
||||
//state.videoVolumeControl.buttonEl.attr();
|
||||
|
||||
// The anchor representing the slider handle behaves as a slider named
|
||||
// volume.
|
||||
@@ -81,7 +81,7 @@ function () {
|
||||
state.videoVolumeControl.volumeSliderHandleEl.attr({
|
||||
'role': gettext('slider'),
|
||||
'title': 'volume',
|
||||
'aria-disabled': 'false',
|
||||
'aria-disabled': false,
|
||||
'aria-valuemin': state.videoVolumeControl.slider.slider('option', 'min'),
|
||||
'aria-valuemax': state.videoVolumeControl.slider.slider('option', 'max'),
|
||||
'aria-valuenow': state.videoVolumeControl.slider.slider('option', 'value'),
|
||||
@@ -178,6 +178,10 @@ function () {
|
||||
'aria-valuenow': ui.value,
|
||||
'aria-valuetext': getVolumeDescription(ui.value)
|
||||
});
|
||||
|
||||
this.videoVolumeControl.buttonEl.attr(
|
||||
'aria-label', this.videoVolumeControl.currentVolume === 0 ? gettext('Volume muted') : gettext('Volume')
|
||||
);
|
||||
}
|
||||
|
||||
function toggleMute(event) {
|
||||
@@ -205,7 +209,7 @@ function () {
|
||||
// Returns a string describing the level of volume.
|
||||
function getVolumeDescription(vol) {
|
||||
if (vol === 0) {
|
||||
return 'silent';
|
||||
return 'muted';
|
||||
}
|
||||
else if (vol <= 20) {
|
||||
return 'very low';
|
||||
|
||||
@@ -87,7 +87,7 @@ function () {
|
||||
// (the title attribute is set in video.html template).
|
||||
state.videoSpeedControl.el.children('a').attr({
|
||||
'role': gettext('button'),
|
||||
'aria-disabled': 'false'
|
||||
'aria-disabled': false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -599,11 +599,13 @@ function () {
|
||||
type = 'hide_transcript';
|
||||
this.captionsHidden = true;
|
||||
this.videoCaption.hideSubtitlesEl.attr('title', gettext('Turn on captions'));
|
||||
this.videoCaption.hideSubtitlesEl.text(gettext('Turn on captions'));
|
||||
this.el.addClass('closed');
|
||||
} else {
|
||||
type = 'show_transcript';
|
||||
this.captionsHidden = false;
|
||||
this.videoCaption.hideSubtitlesEl.attr('title', gettext('Turn off captions'));
|
||||
this.videoCaption.hideSubtitlesEl.text(gettext('Turn off captions'));
|
||||
this.el.removeClass('closed');
|
||||
this.videoCaption.scrollCaption();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user