# Embed codes: iframe, script loader and parameters

Videokr gives you two embed codes for the same video. An iframe pointing at /e/VIDEO_ID works anywhere HTML is allowed, and a one-line script loader (embed.js with data-video) inserts a responsive iframe for you and reports its own height for playlists. Both accept autoplay, muted, start and token parameters.

- Section: Documentation (https://videokr.com/docs)
- Page: https://videokr.com/docs/embeds
- Last updated: 2026-08-18

## Iframe embed

```html
<iframe src="https://videokr.com/e/vid_abc123" title="Product tour"
        style="width:100%;aspect-ratio:16/9;border:0"
        allow="autoplay; fullscreen; picture-in-picture; encrypted-media"
        loading="lazy"></iframe>
```

Use the iframe when the host page restricts scripts (many CMS and email-builder contexts do). Keep `aspect-ratio` on the iframe rather than a fixed height so it stays responsive, and keep `loading="lazy"` so an embed below the fold costs the page nothing until it is scrolled into view.

## Script loader

```html
<script src="https://videokr.com/embed.js" data-video="vid_abc123" async></script>
```

The loader replaces itself with a correctly-shaped, responsive box, sets the iframe `allow` list and `loading="lazy"` for you, and — for a playlist — listens for the player's own height message so the queue is never clipped.

Attributes:

| Attribute | Purpose |
| --- | --- |
| `data-video` | Video id or slug. |
| `data-playlist` | Playlist id or slug (instead of `data-video`). |
| `data-target` | CSS selector to mount into, instead of in place. |
| `data-width` | Any CSS width; defaults to `100%`. |
| `data-ratio` | `16/9` for a video, `16/11` default for a playlist. |
| `data-autoplay` | Start playback when allowed by the browser. |
| `data-muted` | Required alongside autoplay in most browsers. |
| `data-start` | Start at N seconds. |
| `data-token` | Access token for a password-protected video. |

## URL parameters

The same options work on the iframe URL: `/e/vid_abc123?autoplay=1&muted=1&start=30`. A playlist embed uses `/ep/PLAYLIST`.

Autoplay only starts without a click when the video is muted — that is a browser rule, not a Videokr one. An autoplaying muted loop with a visible unmute control converts better than a forced-sound autoplay that the browser blocks anyway.

## Multiple embeds on one page

Both forms are safe to repeat. Each embed is a separate player in its own iframe, so styles cannot leak between your page and the player either way.

## Deep links and public pages

Every video also has a shareable public page at `/v/slug` with `?t=90` deep linking into a moment, and a Markdown twin at `/v/slug.md` for assistants. See [SEO video pages](/guides/video-seo).

## Access-controlled embeds

A [domain-locked](/docs/privacy) video only plays on the hostnames you list — wildcards allowed — and refuses anywhere else, so a copied embed code is worthless on someone else's site. A password-protected video needs a token, which the public page issues after the password is entered.

## FAQ

### Which embed should I use?

The script loader, unless your CMS strips scripts — it handles sizing and lazy loading for you. Use the plain iframe where scripts are not allowed.

### Does the embed work outside WordPress?

Yes. Both embeds are plain HTML and work on any site or framework. The WordPress plugin is a convenience, not a requirement.

## Related

- [Quickstart: host a video and embed it](https://videokr.com/docs/quickstart)
- [Playlists and related videos](https://videokr.com/docs/playlists)
- [How to embed a video on a website](https://videokr.com/guides/embed-video-on-website)
- [Five video embed mistakes that cost you conversions](https://videokr.com/blog/five-embed-mistakes)

---
Videokr — Videokr is hosted video for marketing sites: upload or link a video, brand the player, capture emails inside it, embed it anywhere and read second-by-second retention. Free tier forever, $69 lifetime, or metered plans.
Plans: https://videokr.com/#pricing · Full reference: https://videokr.com/llms-full.txt
