Commit 375341b8 by Awais Jibran

Merge pull request #8455 from edx/aj/tnl2165-play-video-emitted-with-wrong-params

Fixed 'play_video' event which was emitting with wrong params.
parents 9f0b5ed2 989091d1
......@@ -333,6 +333,30 @@ function (VideoPlayer) {
});
});
describe('onSeek Youtube', function(){
beforeEach(function () {
state = jasmine.initializePlayerYouTube();
state.videoEl = $('video, iframe');
});
describe('when the video is playing', function () {
beforeEach(function(){
state.videoPlayer.onStateChange({
data: YT.PlayerState.PLAYING
});
});
it('Video has started playing', function () {
expect($('.video_control')).toHaveClass('pause');
});
it('seek the player', function () {
state.videoPlayer.seekTo(10);
expect(state.videoPlayer.currentTime).toBe(10);
});
});
});
describe('onSeek', function () {
beforeEach(function () {
state = jasmine.initializePlayer();
......
......@@ -493,8 +493,6 @@ function (HTML5Video, Resizer) {
if (this.videoPlayer.isPlaying()) {
this.videoPlayer.stopTimer();
} else {
this.videoPlayer.currentTime = time;
}
var isUnplayed = this.videoPlayer.isUnstarted() ||
this.videoPlayer.isCued();
......@@ -521,6 +519,8 @@ function (HTML5Video, Resizer) {
if (this.videoPlayer.isPlaying()) {
this.videoPlayer.runTimer();
}
// Update the the current time when user seek. (YoutubePlayer)
this.videoPlayer.currentTime = time;
}
function runTimer() {
......
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