justinribeiro / lite-youtube

The fastest little YouTube web component on this side of the internet. The shadow dom web component version of Paul's lite-youtube-embed.
https://www.npmjs.com/package/@justinribeiro/lite-youtube
MIT License
948 stars 70 forks source link

Webp images missing #24

Closed pableu closed 2 years ago

pableu commented 3 years ago

There are a multitude of videos that do not have the webp thumbnail.

Paul Irish even mentions the unreliability in his code:

    * Lo, the youtube placeholder image!  (aka the thumbnail, poster image, etc)
    * There is much internet debate on the reliability of thumbnail URLs. Weak consensus is that you
    * cannot rely on anything and have to use the YouTube Data API.

https://github.com/paulirish/lite-youtube-embed/blob/a927d63781883088c185cb69a0baade52732ab3e/src/lite-yt-embed.js#L22

I have not spent a lot of time with this, but I think there's no good and simple solution for this that includes webp. The easy and pragmatic solution is probably to simply forgo the webp version.

13111y commented 3 years ago

I'm using it within PageFly on Shopify and it serves .webP facades fine. 'A' grade on GTMetrix :D Screenshot 2021-06-15 at 17 03 16

justinribeiro commented 2 years ago

Closing as this component has JPG fallback in the picture element.