Merge pull request #5612 from edx/waheed/tnl89-add-missing-required-states-for-video--progress-slider

Added three missing required states for video progress slider.
This commit is contained in:
Waheed Ahmed
2014-10-21 13:23:42 +05:00
2 changed files with 15 additions and 1 deletions

View File

@@ -122,6 +122,11 @@
'option', 'value', 20
);
});
it('required aria values updated', function () {
expect(state.videoProgressSlider.handle.attr('aria-valuenow')).toBe('20');
expect(state.videoProgressSlider.handle.attr('aria-valuemax')).toBe('120');
});
});
});

View File

@@ -76,7 +76,10 @@ function () {
'title': gettext('Video position'),
'aria-disabled': false,
'aria-valuetext': getTimeDescription(state.videoProgressSlider
.slider.slider('option', 'value'))
.slider.slider('option', 'value')),
'aria-valuemax': state.videoPlayer.duration(),
'aria-valuemin': '0',
'aria-valuenow': state.videoPlayer.currentTime
});
}
@@ -243,6 +246,12 @@ function () {
.slider('option', 'max', duration)
.slider('option', 'value', time);
}
// Update aria values.
this.videoProgressSlider.handle.attr({
'aria-valuemax': duration,
'aria-valuenow': time
});
}
// When the video stops playing (either because the end was reached, or