Commit 6910ac95 by Valera Rozuvan

Addressing reviewer's comments.

Updated Change Log.

BLD-488
parent 75285174
...@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes, ...@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected. the top. Include a label indicating the component affected.
Blades: a11y - Videos will alert screenreaders when the video is over.
LMS: Trap focus on the loading element when a user loads more threads LMS: Trap focus on the loading element when a user loads more threads
in the forum sidebar to improve accessibility. in the forum sidebar to improve accessibility.
......
...@@ -4,28 +4,23 @@ ...@@ -4,28 +4,23 @@
videoProgressSlider, videoSpeedControl, videoVolumeControl, videoProgressSlider, videoSpeedControl, videoVolumeControl,
oldOTBD; oldOTBD;
function initialize(config) { function initialize(fixture, params) {
if (config) { if (_.isString(fixture)) {
if (config.fixture) { loadFixtures(fixture);
loadFixtures(config.fixture); } else {
} else { if (_.isObject(fixture)) {
loadFixtures('video_all.html'); params = fixture;
} }
if (config.startTime) {
$('#example')
.find('#video_id')
.data('start', config.startTime);
}
if (config.endTime) {
$('#example')
.find('#video_id')
.data('end', config.endTime);
}
} else {
loadFixtures('video_all.html'); loadFixtures('video_all.html');
} }
if (_.isObject(params)) {
$('#example')
.find('#video_id')
.data(params);
}
state = new Video('#example'); state = new Video('#example');
state.videoEl = $('video, iframe'); state.videoEl = $('video, iframe');
...@@ -56,7 +51,7 @@ ...@@ -56,7 +51,7 @@
} }
function initializeYouTube() { function initializeYouTube() {
initialize({fixture: 'video.html'}); initialize('video.html');
} }
beforeEach(function () { beforeEach(function () {
...@@ -548,10 +543,10 @@ ...@@ -548,10 +543,10 @@
}); });
describe('update with start & end time', function () { describe('update with start & end time', function () {
var START_TIME = 2, END_TIME = 4; var START_TIME = 1, END_TIME = 2;
beforeEach(function () { beforeEach(function () {
initialize({startTime: START_TIME, endTime: END_TIME}); initialize({start: START_TIME, end: END_TIME});
spyOn(videoPlayer, 'update').andCallThrough(); spyOn(videoPlayer, 'update').andCallThrough();
spyOn(videoPlayer, 'pause').andCallThrough(); spyOn(videoPlayer, 'pause').andCallThrough();
...@@ -673,9 +668,12 @@ ...@@ -673,9 +668,12 @@
}); });
}); });
describe('updatePlayTime with start & end times', function () { describe('updatePlayTime when start & end times are defined', function () {
var START_TIME = 1,
END_TIME = 2;
beforeEach(function () { beforeEach(function () {
initialize({startTime: 2, endTime: 4}); initialize({start: START_TIME, end: END_TIME});
spyOn(videoPlayer, 'updatePlayTime').andCallThrough(); spyOn(videoPlayer, 'updatePlayTime').andCallThrough();
spyOn(videoPlayer.player, 'seekTo').andCallThrough(); spyOn(videoPlayer.player, 'seekTo').andCallThrough();
...@@ -699,16 +697,14 @@ ...@@ -699,16 +697,14 @@
}, 'duration becomes available', 1000); }, 'duration becomes available', 1000);
runs(function () { runs(function () {
expect(videoPlayer.startTime).toBe(2); expect(videoPlayer.startTime).toBe(START_TIME);
expect(videoPlayer.endTime).toBe(4); expect(videoPlayer.endTime).toBe(END_TIME);
expect(videoPlayer.player.seekTo).toHaveBeenCalledWith(2); expect(videoPlayer.player.seekTo).toHaveBeenCalledWith(START_TIME);
expect(videoProgressSlider.updateStartEndTimeRegion) expect(videoProgressSlider.updateStartEndTimeRegion)
.toHaveBeenCalledWith({duration: duration}); .toHaveBeenCalledWith({duration: duration});
// videoProgressSlider.updateStartEndTimeRegion
expect(videoPlayer.seekToStartTimeOldSpeed).toBe(state.speed); expect(videoPlayer.seekToStartTimeOldSpeed).toBe(state.speed);
}); });
}); });
...@@ -716,7 +712,7 @@ ...@@ -716,7 +712,7 @@
describe('updatePlayTime with invalid endTime', function () { describe('updatePlayTime with invalid endTime', function () {
beforeEach(function () { beforeEach(function () {
initialize({endTime: 100000}); initialize({end: 100000});
spyOn(videoPlayer, 'updatePlayTime').andCallThrough(); spyOn(videoPlayer, 'updatePlayTime').andCallThrough();
}); });
......
...@@ -228,8 +228,9 @@ function () { ...@@ -228,8 +228,9 @@ function () {
// onPlay(), and update() (update method handles endTime). // onPlay(), and update() (update method handles endTime).
function notifyThroughHandleEnd(params) { function notifyThroughHandleEnd(params) {
if (params.end) { if (params.end) {
this.videoProgressSlider.handle.attr('title', 'video ended'); this.videoProgressSlider.handle
this.videoProgressSlider.handle.focus(); .attr('title', 'video ended')
.focus();
} else { } else {
this.videoProgressSlider.handle.attr('title', 'video position'); this.videoProgressSlider.handle.attr('title', 'video position');
} }
......
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