diff --git a/common/lib/xmodule/xmodule/js/src/video/03_video_player.js b/common/lib/xmodule/xmodule/js/src/video/03_video_player.js index b0c0454408..a95b9f2605 100644 --- a/common/lib/xmodule/xmodule/js/src/video/03_video_player.js +++ b/common/lib/xmodule/xmodule/js/src/video/03_video_player.js @@ -815,18 +815,18 @@ function (HTML5Video, Resizer) { function updatePlayTime(time, skip_seek) { var videoPlayer = this.videoPlayer, - duration = this.videoPlayer.duration(), + endTime = this.videoPlayer.duration(), youTubeId; if (this.config.endTime !== null) { - duration = Math.min(this.config.endTime, duration); + endTime = Math.min(this.config.endTime, endTime); } this.trigger( 'videoProgressSlider.updatePlayTime', { time: time, - duration: duration + duration: endTime } ); @@ -834,7 +834,7 @@ function (HTML5Video, Resizer) { 'videoControl.updateVcrVidTime', { time: time, - duration: duration + duration: endTime } ); diff --git a/common/lib/xmodule/xmodule/js/src/video/04_video_control.js b/common/lib/xmodule/xmodule/js/src/video/04_video_control.js index c269ac4210..561c8c02d6 100644 --- a/common/lib/xmodule/xmodule/js/src/video/04_video_control.js +++ b/common/lib/xmodule/xmodule/js/src/video/04_video_control.js @@ -296,10 +296,10 @@ function () { } function updateVcrVidTime(params) { - var duration = (this.config.endTime !== null) ? this.config.endTime : params.duration; + var endTime = (this.config.endTime !== null) ? this.config.endTime : params.duration; // in case endTime is accidentally specified as being greater than the video - duration = Math.min(duration, params.duration); - this.videoControl.vidTimeEl.html(Time.format(params.time) + ' / ' + Time.format(duration)); + endTime = Math.min(endTime, params.duration); + this.videoControl.vidTimeEl.html(Time.format(params.time) + ' / ' + Time.format(endTime)); } }); diff --git a/common/lib/xmodule/xmodule/js/src/video/06_video_progress_slider.js b/common/lib/xmodule/xmodule/js/src/video/06_video_progress_slider.js index a267bcf9c1..1fdaba37e2 100644 --- a/common/lib/xmodule/xmodule/js/src/video/06_video_progress_slider.js +++ b/common/lib/xmodule/xmodule/js/src/video/06_video_progress_slider.js @@ -164,10 +164,10 @@ function () { function onSlide(event, ui) { var time = ui.value, - duration = this.videoPlayer.duration(); + endTime = this.videoPlayer.duration(); if (this.config.endTime !== null) { - duration = Math.min(this.config.endTime, duration); + endTime = Math.min(this.config.endTime, endTime); } this.videoProgressSlider.frozen = true; @@ -180,7 +180,7 @@ function () { 'videoControl.updateVcrVidTime', { time: time, - duration: duration + duration: endTime } ); @@ -226,10 +226,10 @@ function () { // params.duration could accidentally be construed as a floating // point double. Since we're displaying this number, round down // to nearest second - var duration = Math.floor(params.duration); + var endTime = Math.floor(params.duration); if (this.config.endTime !== null) { - duration = Math.min(this.config.endTime, duration); + endTime = Math.min(this.config.endTime, endTime); } if ( @@ -237,13 +237,13 @@ function () { !this.videoProgressSlider.frozen ) { this.videoProgressSlider.slider - .slider('option', 'max', duration) + .slider('option', 'max', endTime) .slider('option', 'value', time); } // Update aria values. this.videoProgressSlider.handle.attr({ - 'aria-valuemax': duration, + 'aria-valuemax': endTime, 'aria-valuenow': time }); }