vvvmax / unitegallery

Unite Gallery - Responsive jQuery Image and Video Gallery Plugin. Aim to be the best gallery on the web on it's kind. See demo here:
http://unitegallery.net
MIT License
531 stars 158 forks source link

Youtube preview in different resolutions. #212

Open pjar opened 5 years ago

pjar commented 5 years ago

The lib has hardcoded resolution of the image for the preview it will donwload:

his.getVideoImages = function(videoID){
        var obj = {};
        obj.preview = "https://i.ytimg.com/vi/"+videoID+"/sddefault.jpg";
        obj.thumb = "https://i.ytimg.com/vi/"+videoID+"/default.jpg";
        return(obj);
    }

But some videos don't have sddefault.jpg version and it will show a fallback image: Image of sddefault

while they have other resolutions (here default.jpg): Image of default

It would be great if other resolutions were supported, or we could pass an option of which version of the image should be used.