From 011c7df6758fc692e4c52ae91eb27e0a45b03eed Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Fri, 16 Mar 2018 20:11:08 +0100 Subject: [PATCH] HFP-1905 Add metadata to contentData --- js/h5p.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index dd74a79..34a1223 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -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!