How to use it
- Paste the YouTube video link or its 11-character ID.
- Set start and stop times and the playback options you want.
- Choose responsive or a fixed size, and set a descriptive title.
- Copy the HTML and paste it into your page or your site builder's HTML block. Use Show preview to test it.
How it works
The code uses YouTube's standard iframe player. Options become URL parameters on the player address: start and end (seconds), autoplay, mute, loop with playlist, controls=0, cc_load_policy=1 for captions, cc_lang_pref for the caption language and hl for the player language. Privacy-enhanced mode switches the address to youtube-nocookie.com.
Some options have limits set by YouTube or by browsers. Autoplay works only when the video is muted, so the tool adds mute=1 with autoplay. Looping a single video needs the playlist parameter set to the same video ID, which the tool adds. Captions only appear if the video has captions. Videos whose owners disabled embedding will show an error in the player.
Responsive mode wraps the iframe in a box with aspect-ratio: 16 / 9 and width: 100%, so it scales with the page without the older padding-bottom trick. Fixed mode writes width and height attributes. Lazy loading delays the player until it is near the visible part of the page.
Examples
Privacy-friendly responsive embed
Default settings: youtube-nocookie.com, responsive 16:9 and lazy loading. Paste the snippet into any HTML page.
Background-style loop
Autoplay, loop and no controls produce …/embed/ID?autoplay=1&mute=1&loop=1&playlist=ID&controls=0.
Play only one section
Start at 1:00 and stop at 2:30 give start=60&end=150, so the player plays that part only.
Frequently asked questions
Why does my embedded video not autoplay with sound?
Browsers block autoplay with sound. Autoplay needs mute=1, which the tool adds automatically; some browsers or settings still block it.
What does privacy-enhanced mode do?
It loads the player from youtube-nocookie.com. According to YouTube, information about visitors is then not stored for personalisation unless they play the video.
Why do I need playlist= for looping?
YouTube's loop parameter only works with a playlist. Setting playlist to the same video ID makes a single video repeat.
Does the generated code work in WordPress?
Yes. Paste it into a Custom HTML block. Some site builders strip iframes for security reasons; then use their own video block.
Privacy
The embed code is built in your browser and nothing is sent anywhere. Only if you click Show preview does your browser load the player from YouTube (or youtube-nocookie.com).