In the isVideo() function there is a test for src which throws an error if a src is not provided. Cool. But later there is this:
if (!src && html) {
return {
html5: true
};
If src is "falsey" then we would never get that far. I'm running into this while trying to sort out why I can't get dynamic html5 video to work with lightgallery.js in an Electron desktop project.
I don't know if the above is a bug or not (not a JS hero...) but changing that to affirmative tests (if src && html) seems to give a correct result.
In context:
Plugin.prototype.isVideo = function(src, index) {
if(!src) {
throw new Error("Make sure that slide " + index + " has an image/video src");
}
var html;
if (this.s.dynamic) {
html = this.s.dynamicEl[index].html;
} else {
html = this.items[index].getAttribute('data-html');
}
if (!src && html) {
return {
html5: true
};
}
//etc
In the
isVideo()
function there is a test forsrc
which throws an error if asrc
is not provided. Cool. But later there is this:If
src
is "falsey" then we would never get that far. I'm running into this while trying to sort out why I can't get dynamic html5 video to work with lightgallery.js in an Electron desktop project.I don't know if the above is a bug or not (not a JS hero...) but changing that to affirmative tests (if src && html) seems to give a correct result.
In context: