How to Embed a YouTube Live Stream on Your Website (Permanent URL)
Embed your 24/7 webcam live stream directly on your website, so visitors watch on your page instead of leaving for YouTube. This guide shows the embed method that keeps working when your stream restarts — the most common mistake with webcam embeds.
No stream yet? Set one up first: YouTube Live Setup.
The problem: Video IDs change
When you click Share → Embed on a live video, YouTube gives you code with a Video ID:
<iframe width="560" height="315"
src="https://www.youtube.com/embed/VIDEO_ID"
frameborder="0" allowfullscreen></iframe>Don’t use this for webcam streams. Every time your stream ends and restarts (network hiccup, camera reboot), YouTube creates a new Video ID — and your embedded player shows an ended video.
The solution: Permanent Channel ID embed
Use the live_stream endpoint with your Channel ID instead. It always shows whatever is currently live on your channel:
<iframe width="560" height="315"
src="https://www.youtube.com/embed/live_stream?channel=YOUR_CHANNEL_ID"
frameborder="0" allowfullscreen></iframe>Find your Channel ID in YouTube Studio under Settings → Channel → Advanced settings (starts with UC…).
Responsive embed (recommended)
For a player that scales with the page width (16:9):
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
<iframe
src="https://www.youtube.com/embed/live_stream?channel=YOUR_CHANNEL_ID"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
frameborder="0" allowfullscreen></iframe>
</div>Works in plain HTML, WordPress (Custom HTML block), Wix, Squarespace and most CMS editors.
Checklist before embedding
- Stream visibility is Public or Unlisted (Private streams cannot be embedded)
- “Allow embedding” is enabled: YouTube Studio → your stream → Edit
- YouTube may require a linked AdSense account for live-stream embedding on some channels
- Use Scheduled Streams in webcam.io setup (the default “Stream Tab” breaks 24/7 streaming — see YouTube Live Setup)
Troubleshooting
- Player shows “Video unavailable”
- Embedding is disabled, the stream is Private, or AdSense linking is required. Test the embed in a private/incognito browser window.
- Player shows an old, ended stream
- You embedded a Video ID. Switch to the Channel ID method above.
- Nothing live right now
- The Channel ID embed shows an error when no stream is live. Enable the Backup stream option in webcam.io to keep your stream alive during short camera or network outages.
- Embedding still won’t work
- Consider Twitch instead — embedding is simpler and has no AdSense requirement.
Multiple cameras on one page
Each camera needs its own stream. Either use separate Scheduled Streams with Video-ID embeds you update after restarts (not recommended), or — cleaner — one YouTube channel per camera with permanent Channel ID embeds. See YouTube Live Setup for running multiple streams.
Ready to put your camera live? Start your free 7-day trial — no credit card required.