// the find
paulirish/lite-youtube-embed
A faster youtube embed.
A web component that renders a YouTube thumbnail and play button instead of loading the full YouTube iframe until the user clicks. Drops your page's third-party request count from ~20 to zero until interaction. Written by Paul Irish (Chrome DevTools, Lighthouse), so the performance motivation is credible.
Uses youtube-nocookie.com by default — you get the privacy win without thinking about it. Progressive enhancement variant degrades gracefully to a plain anchor tag when JS hasn't loaded yet, which is the right way to build this. The js-api param bridges to the full IFrame Player API post-click, so you're not locked out of programmatic control. Zero dependencies, two files (one JS, one CSS), and it's a proper custom element so it slots into any framework without wrappers.
The poster image is fetched from ytimg.com on page load even in the lazy variant, so you're still making a cross-origin request before any click — the privacy story is better than a full embed but not zero. No autoplay-on-scroll or intersection-observer trigger; if you want the video to load when it enters the viewport you wire that yourself. The `params` attribute is a raw query string you paste in, which is fine but means no validation and easy to get wrong. Project is effectively feature-complete and low-activity, so if YouTube changes something in their embed API (they have before) you may be waiting on a community fix rather than an active maintainer.