paulirish / lite-youtube-embed

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

Added lazy parameter and test cases for preload #103

Closed kevinfarrugia closed 2 years ago

kevinfarrugia commented 2 years ago

Tackles #102.

I have added the optional lazy attribute to not change existent behaviour and created two new test cases:

Note: Possibly lazy is a misleading name as the image is not really lazy loaded, just not preloaded.

paulirish commented 2 years ago

Note: Possibly lazy is a misleading name as the image is not really lazy loaded, just not preloaded.

yeah i was def confused. fwiw #11 is our lazy attribute issue.

/variants/lazy.html - uses the new lazy param and pushes the image outside of the viewport to lower the priority of the request

so.. what i'm seeing is that preload or not, the image loads with the same priority (Low) as it had been.

whereas in preload.html the image loads with 'high' priority.. contradicting what i was saying in #102.

all this explored.. I'm probably closer to just removing the preload for the posterImage

paulirish commented 2 years ago

closed by #106