paulirish / lite-youtube-embed

A faster youtube embed.
https://paulirish.github.io/lite-youtube-embed/
Other
5.84k stars 271 forks source link

Upgrade poster image to higher resolution webp if possible #167

Closed paulirish closed 7 months ago

paulirish commented 7 months ago

fixes #70.

The default has been the hqdefault jpg, which is only 360px tall, but standard embed height is 405px. So it's always been getting scaled.

With this PR, we still default to the above jpg, but we'll see if the sddefault webp (480px tall) is available for the specific video. If so, we swap it in.

ref #76


You can always just have ultimate control over the poster image by setting a style=background-image manually: https://github.com/paulirish/lite-youtube-embed/#custom-poster-image (long-time feature).

And I made an interactive page that finds the best poster image available for your video: https://paulirish.github.io/lite-youtube-embed//testpage/poster-image-availability.html