The iframe embed is a single block of HTML that loads the player in a sandboxed iframe. It is the most compatible option and works on every CMS and static site that allows raw HTML.
The snippet
The dashboard provides this snippet. Replace your-slug with your video's slug:
<iframe
src="https://videoplayer.ai/embed/your-slug"
width="640"
height="360"
frameborder="0"
allow="autoplay; fullscreen; picture-in-picture"
allowfullscreen
></iframe>
What each attribute does
| Attribute | Purpose |
|---|---|
src |
Points at the embed page for your video |
width, height |
Fixed pixel size; consider the responsive wrapper for fluid layouts |
frameborder="0" |
Removes the legacy iframe border |
allow |
Whitelists browser features the player needs |
allowfullscreen |
Permits fullscreen via the player control |
Customizing
The embed page accepts a few query parameters:
| Parameter | Effect |
|---|---|
autoplay=1 |
Starts playback automatically (browsers may still block it without muted=1) |
muted=1 |
Starts muted |
loop=1 |
Loops the video |
controls=0 |
Hides the player controls (use only when you have custom controls outside the iframe) |
When this is the wrong choice
The iframe embed has a fixed pixel size. If you want the player to scale with its container, use the responsive wrapper. If you want a faster first paint with a poster image until the user clicks play, use the lite script embed.