Skip to content

Commit

Permalink
Don’t report video length if not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
figureone committed Apr 26, 2018
1 parent 5501579 commit 7ab090b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/x-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ H5P.VideoXAPI = (function ($) {
volume = formatFloat(volume);

var extensions = {};
extensions['https://w3id.org/xapi/video/extensions/length'] = videoLength;
if (typeof isFullscreen !== 'undefined') {

if (typeof videoLength !== 'undefined') {
extensions['https://w3id.org/xapi/video/extensions/length'] = videoLength;
}
if (typeof isFullscreen !== 'undefined' && isFullscreen) {
extensions['https://w3id.org/xapi/video/extensions/full-screen'] = isFullscreen;
}
if (typeof screenSize !== 'undefined') {
Expand Down

0 comments on commit 7ab090b

Please sign in to comment.