From e8f90c91167886ed4ef8007c5a186c7075c50998 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Thu, 8 Sep 2016 16:34:53 +0200 Subject: [PATCH] Allow overriding of content URLs h5p/h5p-moodle-plugin#112 --- js/h5p.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index 1fd545c..4d61169 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -691,7 +691,11 @@ H5P.getPath = function (path, contentId) { var prefix; if (contentId !== undefined) { - prefix = H5PIntegration.url + '/content/' + contentId; + // Check for custom override URL + prefix = H5PIntegration.contents['cid-' + contentId].contentUrl; + if (!prefix) { + prefix = H5PIntegration.url + '/content/' + contentId; + } } else if (window.H5PEditor !== undefined) { prefix = H5PEditor.filesPath;