You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can add below function to your code and it should fix.
H5P.isEmpty = value => {
if (!value && value !== 0 && value !== false) {
return true; // undefined, null, NaN and empty strings.
}
else if (Array.isArray(value)) {
for (let i = 0; i < value.length; i++) {
if (!H5P.isEmpty(value[i])) {
return false; // Array contains a non-empty value
}
}
return true; // Empty array
}
else if (typeof value === 'object') {
for (let prop in value) {
if (value.hasOwnProperty(prop) && !H5P.isEmpty(value[prop])) {
return false; // Object contains a non-empty value
}
}
return true; // Empty object
}
return false;
};
Getting the following error when trying to load the interactive video using this library:
Uncaught TypeError: H5P.isEmpty is not a function
This happens when I'm trying to save the current user state. Interactive Video library has the following definition for
getCurrentState
function:Since we are unable to get the current state due to missing
isEmpty
function, so the user state cannot be saved for interactive videos.The text was updated successfully, but these errors were encountered: