Commit fb2f4fda by Waheed Ahmed

Fixed two paly_video events emitted on video replay.

TNL-2166
parent 698f6fb2
......@@ -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();
}
});
......
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