Allow overriding of content URLs

h5p/h5p-moodle-plugin#112
JI-92-path-fix
Frode Petterson 2016-09-08 16:34:53 +02:00
parent 2896c9fdab
commit e8f90c9116
1 changed files with 5 additions and 1 deletions

View File

@ -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;