diff --git a/common/lib/xmodule/xmodule/js/src/video/03_video_player.js b/common/lib/xmodule/xmodule/js/src/video/03_video_player.js index 12b40c123c..a4c268cfa7 100644 --- a/common/lib/xmodule/xmodule/js/src/video/03_video_player.js +++ b/common/lib/xmodule/xmodule/js/src/video/03_video_player.js @@ -49,7 +49,8 @@ function (HTML5Video, Resizer) { update: update, figureOutStartEndTime: figureOutStartEndTime, figureOutStartingTime: figureOutStartingTime, - updatePlayTime: updatePlayTime + updatePlayTime: updatePlayTime, + logStopVideo:logStopVideo }; VideoPlayer.prototype = methodsDict; @@ -348,6 +349,8 @@ function (HTML5Video, Resizer) { this.trigger('videoProgressSlider.notifyThroughHandleEnd', { end: true }); + // Emit `stop_video` event + this.videoPlayer.logStopVideo(); } } } @@ -531,12 +534,7 @@ function (HTML5Video, Resizer) { function onEnded() { var time = this.videoPlayer.duration(); - this.videoPlayer.log( - 'stop_video', - { - currentTime: this.videoPlayer.currentTime - } - ); + this.videoPlayer.logStopVideo(); this.trigger('videoControl.pause', null); this.trigger('videoProgressSlider.notifyThroughHandleEnd', { @@ -593,6 +591,15 @@ function (HTML5Video, Resizer) { this.videoPlayer.player.setPlaybackQuality(value); } + function logStopVideo(){ + this.videoPlayer.log( + 'stop_video', + { + currentTime: this.videoPlayer.currentTime + } + ); + } + function onPlaybackQualityChange() { var quality;