Click-to-load video embed

A standard video embed starts talking to the video platform the moment your page opens, whether anyone watches or not. This builder writes one that keeps quiet until a visitor presses play.

Any YouTube form works (watch?v=, youtu.be, shorts, embed, a t= start time included), and so does a Vimeo link, even an unlisted one that carries an h= code.

What the code should do

The code is built by your browser. The link you paste is not transmitted to our server or to anyone else.

What an ordinary embed does before anyone watches

The snippet you copy from a video’s Share menu is an <iframe>, a small window onto another website set inside your page. The browser fills that window as soon as it draws the page. For one YouTube video, that’s roughly twenty requests and several hundred kilobytes of script, fetched from Google servers for every visitor, including all the ones who scroll right past.

Each of those requests carries the visitor’s IP address and the address of your page. The player can also read and write its own storage in the browser. So your page gets slower, and your visitors get noticed by a company they never chose to contact.

The two kinds of code this tool writes

Click to load
Your page gets a link dressed up as a video frame, with a poster image, a play triangle and an accessible label. A short script, included once, waits for a click on that link and only then swaps in the real player with autoplay=1, so one press is enough on most devices. If the script is missing or blocked, the link still works and opens the video on the platform in a new tab.
Plain iframe on the privacy-enhanced domain
No script at all. The player loads with the page, but from youtube-nocookie.com, or from Vimeo with dnt=1, and with loading="lazy" so a video far down the page waits until the visitor scrolls near it.

Either way, the player sits in a box sized with the CSS aspect-ratio property, so it scales with whatever column you put it in. A /shorts/ link is detected and gets a 9:16 box limited to 360 pixels wide.

Your choiceYouTube parameterVimeo parameter
Start timestart=90#t=90s
Captions oncc_load_policy=1, cc_lang_preftexttrack=en
Player languagehl=ennot available
Own channel suggestionsrel=0not needed
Unlisted videoworks as ish= code kept from the link

The poster image is the last leak

For YouTube, the click-to-load code points by default to the video’s thumbnail on i.ytimg.com. That server belongs to Google. It sets no cookie, but it does see the visitor’s IP address when the picture loads. To get down to zero third-party requests, save a frame of the video, upload it to your own site and paste its address in the poster field. Make it an https:// address, because browsers refuse insecure images on secure pages.

Vimeo has no predictable thumbnail address, so the default there is a dark frame showing your title. The same poster field replaces it with a picture.

The words “privacy-enhanced” and “no cookie” describe what happens before playback. Once a visitor presses play, the video is streamed by YouTube or Vimeo, which then receive the usual technical details of that visitor. Click to load doesn’t change that. It leaves the decision to the visitor.

Pasting the code into your site

The output is plain HTML with inline styles, so it doesn’t depend on your theme.

  • WordPress: add a “Custom HTML” block and paste. Administrators can save the <script> part, but accounts with the Editor role on a multisite network may have it stripped on save. If that happens, the poster still links to the video, or you can switch to the plain iframe.
  • Squarespace, Wix, Webflow, Shopify: use the code or embed block, not the built-in video block, which would bring the standard player right back.
  • Static HTML: paste where the video belongs. With several videos on one page, paste each snippet in full. The script checks whether it has already run.
  • Content-Security-Policy: allow www.youtube-nocookie.com or player.vimeo.com in frame-src. A policy that forbids inline scripts will block the click-to-load script, so move it to a file you serve yourself.

Always fill in the title field. It becomes the title of the iframe and the label of the play link, and that’s what a screen reader announces. Leave it empty and all the listener hears is “YouTube video”.

Questions people ask

Does youtube-nocookie.com really set no cookies?

It sets no tracking cookies while the player is idle. The player script still loads from Google, and it can use the browser’s local storage. After the visitor presses play, YouTube treats the session much like any other view. Only the click-to-load version sends nothing at all before the click.

Do I still need cookie consent for an embedded video?

That depends on the law that applies to you, and it’s a legal question this tool can’t settle. On the technical side, the click-to-load embed with a poster hosted on your own site makes no third-party request until the visitor acts, which is the behavior most consent rules ask for. Mention the video platform in your privacy notice.

Why does the video need two taps on some phones?

The code asks the player to start automatically after the click. Some mobile browsers, and phones in low-power mode, block autoplay with sound inside an iframe. The player then shows up paused and needs a second tap.

Will a click-to-load embed make my page faster?

Yes, and you can measure it. The page no longer downloads the player scripts up front, which takes off several hundred kilobytes and a good share of main-thread work per video. Compare before and after with the page size breakdown.

My Vimeo video shows an error in the preview. Why?

The video is probably unlisted or restricted. Use the link from Vimeo’s Share button, which looks like vimeo.com/123456789/abc123def4. The second part is a key the player requires. If the video is limited to certain domains, add your site in its Vimeo privacy settings.

Can I paste a full iframe code instead of a link?

Yes. If the text you paste contains a src="…" attribute, the tool reads the address inside it and rebuilds the embed from there.