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
836 stars 63 forks source link

Poster image still gets lazy-loaded when setting posterloading to eager #78

Open jlmmns opened 1 year ago

jlmmns commented 1 year ago
<lite-youtube videoid="{{ video }}" posterloading="eager"></lite-youtube>

Results in:

<img id="fallbackPlaceholder" referrerpolicy="origin" loading="lazy" src="..." aria-label="..." alt="...">

I'm using v1.4.0


There seems to be a hard-coded loading="lazy" when the shadow dom gets set up (I guess this is just the default setup): /blob/main/lite-youtube.ts#L210

Maybe the "fallback" reference isn't working here: /blob/main/lite-youtube.ts#L323