gfscott/eleventy-plugin-embed-everything

Better quality thumbnail images

Maximization opened this issue · 2 comments

Love this library, thank you so much! ❤️

Currently the thumbnail images are low quality because it's using hqdefault.jpg by default. Example:

YouTube also provides a maxresdefault.jpg image:

Right now as a workaround I have this in my css (I'm using Tailwind):

.eleventy-plugin-youtube-embed > [videoid='dQw4w9WgXcQ'] {
  @apply !bg-[url('https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg')];
}

It can either be the default, or configurable. I don't think all videos have the better quality available so perhaps configurable is a better approach. Ideally on a per video basis. What do you think?

Yeah, I agree it makes sense to make this configurable in lite mode so you can opt for higher-res thumbnails.

For some older or lower-res videos, the minor risk is you'd get a kind of ugly placeholder if there's no maxresdefault size available (for example: hqdefault.jpg exists vs. maxresdefault.jpg doesn't). But I'm fine with giving the option to any daredevils who opt to live on the edge 😅

At the moment this would have to be a global setting, and the default will need to remain hqdefault. I'm hoping to release a new minor version in the next few weeks, I think this is doable on that time frame.

Thank you for the quick reply!

Sounds good! For videos that don't have a maxresdefault one could change to hqdefault on a per-video-basis using css like in my example (or use an image of your own).