eleventy-plugin-embed-everything icon indicating copy to clipboard operation
eleventy-plugin-embed-everything copied to clipboard

REQ: Lazy load embedded YouTube videos

Open huphtur opened this issue 5 years ago • 3 comments

You're killing it with these plugins Graham, figured I may as well throw another challenge at you...

Be awesome to have an option for lazy loading of YouTube videos: https://css-tricks.com/lazy-load-embedded-youtube-videos/

huphtur avatar Aug 29 '20 17:08 huphtur

It exists! Added lazy as an option in v1.4.0.

To use it with the Everything plugin:

eleventyConfig.addPlugin(embedEverything, {
  youtube: {
    options: {
      lazy: true
    }
  }
});

I feel like I haven't thought of a good way to surface the options available through the underlying standalone plugins — hence why you'd have to go digging to know this feature existed. Open to suggestions on how to make that easier and more discoverable!

gfscott avatar Aug 29 '20 18:08 gfscott

Sorry, should have linked to this: https://dev.to/haggen/lazy-load-embedded-youtube-videos-520g It's a different way of embedding the YouTube video.

huphtur avatar Aug 29 '20 20:08 huphtur

Oh, interesting, this method is new to me but seems pretty doable. Let me look into it!

gfscott avatar Aug 29 '20 22:08 gfscott