Fixed two paly_video events emitted on video replay.
TNL-2166
This commit is contained in:
@@ -51,14 +51,14 @@
|
||||
});
|
||||
});
|
||||
|
||||
it('callback was called', function () {
|
||||
it('callback was not called', function () {
|
||||
waitsFor(function () {
|
||||
return state.videoPlayer.player.getPlayerState() !== STATUS.PAUSED;
|
||||
}, 'Player state should be changed', WAIT_TIMEOUT);
|
||||
|
||||
runs(function () {
|
||||
expect(state.videoPlayer.player.callStateChangeCallback)
|
||||
.toHaveBeenCalled();
|
||||
.not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -85,14 +85,14 @@
|
||||
});
|
||||
});
|
||||
|
||||
it('callback was called', function () {
|
||||
it('callback was not called', function () {
|
||||
waitsFor(function () {
|
||||
return state.videoPlayer.player.getPlayerState() !== STATUS.PLAYING;
|
||||
}, 'Player state should be changed', WAIT_TIMEOUT);
|
||||
|
||||
runs(function () {
|
||||
expect(state.videoPlayer.player.callStateChangeCallback)
|
||||
.toHaveBeenCalled();
|
||||
.not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -290,13 +290,11 @@ function () {
|
||||
var PlayerState = HTML5Video.PlayerState;
|
||||
|
||||
if (_this.playerState === PlayerState.PLAYING) {
|
||||
_this.pauseVideo();
|
||||
_this.playerState = PlayerState.PAUSED;
|
||||
_this.callStateChangeCallback();
|
||||
_this.pauseVideo();
|
||||
} else {
|
||||
_this.playVideo();
|
||||
_this.playerState = PlayerState.PLAYING;
|
||||
_this.callStateChangeCallback();
|
||||
_this.playVideo();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user