Commit 04d27a83 by Anton Stupak

Merge pull request #2571 from Szczork/szczork/log-video-ended

log stop_video event
parents 08011284 77fc849c
......@@ -335,6 +335,7 @@ function (VideoPlayer) {
state.videoEl = $('video, iframe');
spyOn(state.videoPlayer, 'log').andCallThrough();
spyOn(state.videoControl, 'pause').andCallThrough();
spyOn($.fn, 'trigger').andCallThrough();
......@@ -350,6 +351,15 @@ function (VideoPlayer) {
it('pause the video caption', function () {
expect($.fn.trigger).toHaveBeenCalledWith('ended', {});
});
it('log stop_video event', function () {
expect(state.videoPlayer.log).toHaveBeenCalledWith(
'stop_video',
{
currentTime: state.videoPlayer.currentTime
}
);
});
});
});
......
......@@ -506,6 +506,12 @@ function (HTML5Video, Resizer) {
function onEnded() {
var time = this.videoPlayer.duration();
this.videoPlayer.log(
'stop_video',
{
currentTime: this.videoPlayer.currentTime
}
);
this.trigger('videoControl.pause', null);
this.trigger('videoProgressSlider.notifyThroughHandleEnd', {
......
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