JavaScript code vs iframe
Open Videos → video → Embed & Share. Under Embed snippet, choose JavaScript or Iframe, then select Copy code.

- JavaScript is recommended. Use it wherever the page accepts custom HTML and external scripts.
- Iframe is for pages that allow an iframe but block scripts.
Differences
| JavaScript | Iframe | |
|---|---|---|
| The page must allow scripts | Yes | No |
| Where to copy it | Embed & Share and the workspace catalog | Embed & Share only |
| What the code points to | The player ID | The video's share link on watch.atomicplayer.ai, followed by /embed |
| window.atomicplayer and DOM events on your page | Yes | No. The player sends atomicplayer:event messages to the parent page |
| A/B test embed | Yes | No |
| Who can watch | Applies | Applies |
| Domain lock | Plays only on allowed domains | Only allowed domains can frame it |
Things to know about the iframe
- The iframe code contains the share link. While the video is Unlisted, that link includes a secret. If you select Reset link, or switch the video to Unlisted, copy the iframe code again. See Share pages and who can watch.
- An Embed only video plays in the iframe, even though its share page shows a notice.
- Playback is reported against the page that holds the iframe, not the watch address. If your site sends a stricter referrer policy, analytics may only get its domain.
If a page builder removes <script> but you still want the JavaScript embed, move the runtime line to the platform's site-wide custom-code area and keep the player container where the video should appear.
Related docs
Frequently asked questions
Can I choose iframe in Embed & Share?
Yes. Choose Iframe under Embed snippet, then select Copy code.
What if my builder removes scripts?
Use the Iframe code, or the builder's custom-code or header/footer script feature with the JavaScript code. Keep the data-player-id container in the page body.
Why did my iframe stop playing?
Check Who can watch. Private videos don't play in embeds, and a reset Unlisted link breaks iframe code copied before the reset.