Made getCopyrights work with empty optional fields
parent
b8a07e4996
commit
31ddbd8379
|
@ -385,7 +385,7 @@ H5P.QuestionSet = function (options, contentId) {
|
||||||
var info = new H5P.ContentCopyrights();
|
var info = new H5P.ContentCopyrights();
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
if (params.backgroundImage.copyright !== undefined) {
|
if (params.backgroundImage !== undefined && params.backgroundImage.copyright !== undefined) {
|
||||||
var background = new H5P.MediaCopyright(params.backgroundImage.copyright);
|
var background = new H5P.MediaCopyright(params.backgroundImage.copyright);
|
||||||
background.setThumbnail(new H5P.Thumbnail(H5P.getPath(params.backgroundImage.path, contentId), params.backgroundImage.width, params.backgroundImage.height));
|
background.setThumbnail(new H5P.Thumbnail(H5P.getPath(params.backgroundImage.path, contentId), params.backgroundImage.width, params.backgroundImage.height));
|
||||||
info.addMedia(background);
|
info.addMedia(background);
|
||||||
|
@ -404,15 +404,19 @@ H5P.QuestionSet = function (options, contentId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success video
|
// Success video
|
||||||
var video = params.endGame.successVideo[0];
|
if (params.endGame.successVideo !== undefined && params.endGame.successVideo.length > 0) {
|
||||||
if (video.copyright !== undefined) {
|
var video = params.endGame.successVideo[0];
|
||||||
info.addMedia(new H5P.MediaCopyright(video.copyright));
|
if (video.copyright !== undefined) {
|
||||||
|
info.addMedia(new H5P.MediaCopyright(video.copyright));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fail video
|
// Fail video
|
||||||
video = params.endGame.failVideo[0];
|
if (params.endGame.failVideo !== undefined && params.endGame.failVideo.length > 0) {
|
||||||
if (video.copyright !== undefined) {
|
video = params.endGame.failVideo[0];
|
||||||
info.addMedia(new H5P.MediaCopyright(video.copyright));
|
if (video.copyright !== undefined) {
|
||||||
|
info.addMedia(new H5P.MediaCopyright(video.copyright));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
|
Loading…
Reference in New Issue