Merge pull request #5294 from edx/waheed/tnl235-fix-video-transcript-not-follow

Fixed transcript not follow with video on seek.
This commit is contained in:
Waheed Ahmed
2014-09-24 14:16:15 +05:00
2 changed files with 25 additions and 0 deletions

View File

@@ -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 () {

View File

@@ -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() {