Merge pull request #2571 from Szczork/szczork/log-video-ended
log stop_video event
This commit is contained in:
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user