HFP-1905 Add metadata to contentData

pull/52/head
Oliver Tacke 2018-03-16 20:11:08 +01:00
parent 0fb35a3f7c
commit 011c7df675
1 changed files with 6 additions and 1 deletions

View File

@ -99,7 +99,8 @@ H5P.init = function (target) {
}
var library = {
library: contentData.library,
params: JSON.parse(contentData.jsonContent)
params: JSON.parse(contentData.jsonContent),
metadata: contentData.metadata
};
H5P.getUserData(contentId, 'state', function (err, previousState) {
@ -795,6 +796,10 @@ H5P.newRunnable = function (library, contentId, $attachTo, skipResize, extras) {
extras.previousState = library.userDatas.state;
}
if (library.metadata) {
extras.metadata = library.metadata;
}
// Makes all H5P libraries extend H5P.ContentType:
var standalone = extras.standalone || false;
// This order makes it possible for an H5P library to override H5P.ContentType functions!