blueimp / Gallery

blueimp Gallery is a touch-enabled, responsive and customizable image & video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading.
https://blueimp.github.io/Gallery/
Other
3.75k stars 984 forks source link

Change 'maxresdefault.jpg' to 'hqdefault.jpg'? #217

Closed EstesE closed 8 years ago

EstesE commented 8 years ago

Not all videos have a maxresdefault.jpg. Would it make more sense to default to hqdefault.jpg?

Example: https://img.youtube.com/vi/jNQXAC9IVRw/maxresdefault.jpg https://img.youtube.com/vi/jNQXAC9IVRw/hqdefault.jpg

Changed

if (this.getItemProperty(obj, options.videoPosterProperty) === undefined) {
    obj[options.videoPosterProperty] = '//img.youtube.com/vi/' + videoId +
        '/maxresdefault.jpg'
}

to

if (this.getItemProperty(obj, options.videoPosterProperty) === undefined) {
    obj[options.videoPosterProperty] = '//img.youtube.com/vi/' + videoId +
        '/hqdefault.jpg'
}
blueimp commented 8 years ago

Thanks for your contribution, @Mithrilhall.

Unfortunately, using hqdefault.jpg by default is not an ideal solution either, because it will return a lower quality image than what is available for HD videos, which might be the majority nowadays.

Since it is possible to override the displayed image using the poster property for each gallery image, I prefer to keep it as is at the moment.