diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js index e42143cc38..d94557733f 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js @@ -382,6 +382,26 @@ function (VideoPlayer) { }, 'video didn\'t start playing', WAIT_TIMEOUT); }); + + it('call runTimer in seekTo on player', function () { + runs(function () { + spyOn(state.videoPlayer, 'stopTimer'); + spyOn(state.videoPlayer, 'runTimer'); + state.videoPlayer.seekTo(10); + }); + + waitsFor(function () { + return state.videoPlayer.currentTime >= 10; + }, 'currentTime is less than 10 seconds', WAIT_TIMEOUT); + + runs(function () { + expect(state.videoPlayer.stopTimer) + .toHaveBeenCalled(); + expect(state.videoPlayer.runTimer) + .toHaveBeenCalled(); + }); + }); + // as per TNL-439 this test is deemed flaky and needs to be fixed. // disabled 09/18/2014 xit('slider event causes log update', function () { 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 6a3834855c..ae00dad38f 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 @@ -489,6 +489,11 @@ function (HTML5Video, Resizer) { this.videoPlayer.updatePlayTime(time, true); this.el.trigger('seek', arguments); + + // the timer is stopped above; restart it. + if (this.videoPlayer.isPlaying()) { + this.videoPlayer.runTimer(); + } } function runTimer() {