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.

Home Page:https://www.npmjs.com/package/@justinribeiro/lite-youtube

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webp images missing

pableu opened this issue · comments

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.

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

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