YouTube’s embed iframe is kind of… awful. Every time you paste a YouTube <iframe>
into your website, it loads hundreds of kilobytes of scripts, and slows down your page. Even if your visitor never clicks “play.”
So I built something to fix that.
👉 EmbedLite.com — a drop-in, open-source replacement for YouTube’s embed iframe that’s lightning fast, SEO-optimized, and privacy-friendly.
💡 The Problem
If you’ve ever run Lighthouse or PageSpeed Insights on a page with multiple YouTube videos, you’ve probably noticed how bad it gets.
A single YouTube embed can:
- Load multiple JavaScript bundles from
youtube.com
,google.com
, anddoubleclick.net
- Add network requests even before interaction
- Delay Largest Contentful Paint (LCP)
- Leak privacy data through tracking pixels and cookies
And that's for each video on the page...
⚡ The Solution: EmbedLite
EmbedLite replaces the heavy YouTube iframe with a tiny, static placeholder — basically a thumbnail and play button. The real YouTube player only loads after the user clicks “play.”
That’s it. No tracking, no preloading, no layout shifts.
All you have to do is change this:
-- <iframe src="https://youtube.com/embed/..."
++ <iframe src="https://embedlite.com/embed/..."
And you’re done.
Your site instantly becomes faster, more privacy-friendly, and better optimized for SEO.
🧩 How It Works
Under the hood, EmbedLite is a super-light static app. It fetches the video thumbnail and title, displays them with minimal HTML and CSS, and only when someone interacts does it swap in the real YouTube iframe.
This means:
- Zero external scripts until play
- No cookies or tracking before user consent
- Smaller total payloads
- Instant page loads, even with multiple videos
It’s inspired by projects like Paul Irish’s lite-youtube-embed and Justin Ribeiro’s lite-youtube, but it’s hosted, API-like, and even simpler to use.
🛠️ Usage
Replace your YouTube embed with an EmbedLite URL:
-- <iframe src="https://www.youtube.com/embed/jNQXAC9IVRw" ...></iframe>
++ <iframe src="https://www.embedlite.com/embed/jNQXAC9IVRw" ...></iframe>
That’s literally it.
You can also pass parameters just like you would to YouTube:
https://embedlite.com/embed/dQw4w9WgXcQ?controls=0&mute=1&start=30&end=120
Or set a custom title:
https://embedlite.com/embed/dQw4w9WgXcQ?autoplay=true&title=Rick%20Astley
☁️ Host It Yourself (If You Want)
You can deploy your own version of EmbedLite anywhere static files can live:
- Cloudflare Pages
- Vercel
- Netlify
- Or your own server
Everything is open source on GitHub: github.com/embedlite/embedlite.
🧠 Why This Matters
By reducing unnecessary network requests and avoiding trackers, EmbedLite:
- Improves Core Web Vitals
- Keeps privacy in the user’s hands
- Makes your frontend simpler and lighter
It’s a small fix with a surprisingly big impact.
🧑💻 What's next?
I built EmbedLite because I was tired of my pages getting bogged down by YouTube embeds. I plan on making a npm package so that it's easy to add to your project. Let me know your thoughts!
In the meantime, give it a try at:
Top comments (0)