TNL-2165
"play_video" event emitted after seeking forward in a video contains old position
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user