Addressing reviewer's comments.
Updated Change Log. BLD-488
This commit is contained in:
@@ -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
|
||||
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
|
||||
in the forum sidebar to improve accessibility.
|
||||
|
||||
|
||||
@@ -4,28 +4,23 @@
|
||||
videoProgressSlider, videoSpeedControl, videoVolumeControl,
|
||||
oldOTBD;
|
||||
|
||||
function initialize(config) {
|
||||
if (config) {
|
||||
if (config.fixture) {
|
||||
loadFixtures(config.fixture);
|
||||
} else {
|
||||
loadFixtures('video_all.html');
|
||||
function initialize(fixture, params) {
|
||||
if (_.isString(fixture)) {
|
||||
loadFixtures(fixture);
|
||||
} else {
|
||||
if (_.isObject(fixture)) {
|
||||
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');
|
||||
}
|
||||
|
||||
if (_.isObject(params)) {
|
||||
$('#example')
|
||||
.find('#video_id')
|
||||
.data(params);
|
||||
}
|
||||
|
||||
state = new Video('#example');
|
||||
|
||||
state.videoEl = $('video, iframe');
|
||||
@@ -56,7 +51,7 @@
|
||||
}
|
||||
|
||||
function initializeYouTube() {
|
||||
initialize({fixture: 'video.html'});
|
||||
initialize('video.html');
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
@@ -548,10 +543,10 @@
|
||||
});
|
||||
|
||||
describe('update with start & end time', function () {
|
||||
var START_TIME = 2, END_TIME = 4;
|
||||
var START_TIME = 1, END_TIME = 2;
|
||||
|
||||
beforeEach(function () {
|
||||
initialize({startTime: START_TIME, endTime: END_TIME});
|
||||
initialize({start: START_TIME, end: END_TIME});
|
||||
|
||||
spyOn(videoPlayer, 'update').andCallThrough();
|
||||
spyOn(videoPlayer, 'pause').andCallThrough();
|
||||
@@ -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 () {
|
||||
initialize({startTime: 2, endTime: 4});
|
||||
initialize({start: START_TIME, end: END_TIME});
|
||||
|
||||
spyOn(videoPlayer, 'updatePlayTime').andCallThrough();
|
||||
spyOn(videoPlayer.player, 'seekTo').andCallThrough();
|
||||
@@ -699,16 +697,14 @@
|
||||
}, 'duration becomes available', 1000);
|
||||
|
||||
runs(function () {
|
||||
expect(videoPlayer.startTime).toBe(2);
|
||||
expect(videoPlayer.endTime).toBe(4);
|
||||
expect(videoPlayer.startTime).toBe(START_TIME);
|
||||
expect(videoPlayer.endTime).toBe(END_TIME);
|
||||
|
||||
expect(videoPlayer.player.seekTo).toHaveBeenCalledWith(2);
|
||||
expect(videoPlayer.player.seekTo).toHaveBeenCalledWith(START_TIME);
|
||||
|
||||
expect(videoProgressSlider.updateStartEndTimeRegion)
|
||||
.toHaveBeenCalledWith({duration: duration});
|
||||
|
||||
// videoProgressSlider.updateStartEndTimeRegion
|
||||
|
||||
expect(videoPlayer.seekToStartTimeOldSpeed).toBe(state.speed);
|
||||
});
|
||||
});
|
||||
@@ -716,7 +712,7 @@
|
||||
|
||||
describe('updatePlayTime with invalid endTime', function () {
|
||||
beforeEach(function () {
|
||||
initialize({endTime: 100000});
|
||||
initialize({end: 100000});
|
||||
|
||||
spyOn(videoPlayer, 'updatePlayTime').andCallThrough();
|
||||
});
|
||||
|
||||
@@ -228,8 +228,9 @@ function () {
|
||||
// onPlay(), and update() (update method handles endTime).
|
||||
function notifyThroughHandleEnd(params) {
|
||||
if (params.end) {
|
||||
this.videoProgressSlider.handle.attr('title', 'video ended');
|
||||
this.videoProgressSlider.handle.focus();
|
||||
this.videoProgressSlider.handle
|
||||
.attr('title', 'video ended')
|
||||
.focus();
|
||||
} else {
|
||||
this.videoProgressSlider.handle.attr('title', 'video position');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user