Merge pull request #7797 from edx/aj/tnl2008-stop-video-event-not-emitted-correctly
Videos should emit `stop_video` event once the video segment is compelte...
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user