EDUCATOR-3930 fix video player speed adjustments

This commit is contained in:
rabiaiftikhar
2019-01-23 17:15:25 +05:00
parent da42499320
commit a85256e109
2 changed files with 3 additions and 3 deletions

View File

@@ -904,9 +904,9 @@ function(VideoPlayer, HLS, _) {
it('set video speed to the new speed', function() {
VideoPlayer.prototype.onSpeedChange.call(state, '0.75', false);
expect(state.setSpeed).toHaveBeenCalledWith('0.75');
expect(state.setSpeed).toHaveBeenCalledWith(0.75);
expect(state.videoPlayer.setPlaybackRate)
.toHaveBeenCalledWith('0.75');
.toHaveBeenCalledWith(0.75);
});
});
});

View File

@@ -427,7 +427,7 @@ function(HTML5Video, HTML5HLSVideo, Resizer, HLS, _, Time) {
);
}
newSpeed = parseFloat(newSpeed).toFixed(2).replace(/\.00$/, '.0');
newSpeed = parseFloat(newSpeed);
this.setSpeed(newSpeed);
this.videoPlayer.setPlaybackRate(newSpeed);
}