Skip to content

Commit

Permalink
Replay f977a64 due to incorrect merge conflict resolution in 94ff7b3
Browse files Browse the repository at this point in the history
  • Loading branch information
figureone committed May 25, 2018
1 parent 9d612b7 commit 3e6a584
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions scripts/html5.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @namespace H5P */
H5P.VideoHtml5 = (function ($) {
'use strict';

/**
* HTML5 video player for H5P.
Expand Down
13 changes: 7 additions & 6 deletions scripts/youtube.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @namespace H5P */
H5P.VideoYouTube = (function ($) {
'use strict';

/**
* YouTube video player for H5P.
Expand Down Expand Up @@ -105,7 +106,7 @@ H5P.VideoYouTube = (function ($) {
}
},
onStateChange: function (state) {
if (state.data > -1 && state.data < 4) {
if (state.data >= H5P.Video.ENDED && state.data <= H5P.Video.BUFFERING) {

// Fix for keeping playback rate in IE11
if (H5P.Video.IE11_PLAYBACK_RATE_FIX && state.data === H5P.Video.PLAYING && playbackRate !== 1) {
Expand All @@ -118,19 +119,19 @@ H5P.VideoYouTube = (function ($) {
self.trigger('stateChange', state.data);

// Calls for xAPI events.
if (state.data === 1) {
if (state.data === H5P.Video.PLAYING) {
// Get and send play call when not seeking.
if (self.seeking === false) {
self.trigger('play', self.videoXAPI.getArgsXAPIPlayed(player.getCurrentTime()));
}
}
else if (state.data === 2) {
else if (state.data === H5P.Video.PAUSED) {
// This is a paused event.
if (self.seeking === false && self.previousState !== 3) {
if (self.seeking === false && self.previousState !== H5P.Video.BUFFERING) {
self.trigger('paused', self.videoXAPI.getArgsXAPIPaused(player.getCurrentTime(), self.duration));
}
}
else if (state.data === 0) {
else if (state.data === H5P.Video.ENDED) {
// Send xapi trigger if video progress indicates finished.
var length = self.duration;
if (length > 0) {
Expand Down Expand Up @@ -215,7 +216,7 @@ H5P.VideoYouTube = (function ($) {
break;
}

return (returnType.toLowerCase().trim()=='width') ? width : height;
return (returnType.toLowerCase().trim() === 'width') ? width : height;
};

/**
Expand Down

0 comments on commit 3e6a584

Please sign in to comment.