Commit 7339f568 by Valera Rozuvan

Merge pull request #2358 from Szczork/szczork/log-speed-change-video

add condition - log speed change / loading video
parents 5541aa9c 08ce047f
...@@ -196,6 +196,17 @@ ...@@ -196,6 +196,17 @@
}); });
}); });
it('speed_change_video event is not logged when speed not change', function () {
expect(state.videoPlayer.log).not.toHaveBeenCalledWith(
'speed_change_video',
{
current_time: state.videoPlayer.currentTime,
old_speed: state.speed,
new_speed: state.speed
}
);
});
it('log the play_video event', function () { it('log the play_video event', function () {
expect(state.videoPlayer.log).toHaveBeenCalledWith( expect(state.videoPlayer.log).toHaveBeenCalledWith(
'play_video', { currentTime: 0 } 'play_video', { currentTime: 0 }
......
...@@ -338,6 +338,7 @@ function (HTML5Video, Resizer) { ...@@ -338,6 +338,7 @@ function (HTML5Video, Resizer) {
newSpeed = parseFloat(newSpeed).toFixed(2).replace(/\.00$/, '.0'); newSpeed = parseFloat(newSpeed).toFixed(2).replace(/\.00$/, '.0');
if (this.speed != newSpeed) {
this.videoPlayer.log( this.videoPlayer.log(
'speed_change_video', 'speed_change_video',
{ {
...@@ -346,6 +347,7 @@ function (HTML5Video, Resizer) { ...@@ -346,6 +347,7 @@ function (HTML5Video, Resizer) {
new_speed: newSpeed new_speed: newSpeed
} }
); );
}
this.setSpeed(newSpeed, true); this.setSpeed(newSpeed, true);
......
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