Video Embeds
Video Embeds
Connecting your website, CMS, or intranet to freedam through video embeds means the video lives in one place and plays everywhere you allow it. Instead of exporting an MP4 and uploading it to each destination, you drop a single iframe into the page — and when the asset is replaced or the embed is revoked, every page reflects it without touching the markup.
What it does
Any video asset in the library can be turned into an embeddable iframe. The embed loads a signed playback URL and streams the video with HLS, so viewers get a resolution suited to their connection without you tuning anything. The iframe is configured with the right permissions for autoplay, encrypted media, picture-in-picture, and fullscreen on browsers that support them.
Playback behaviour is controlled by URL parameters: autoplay (forces muted, since browsers block unmuted autoplay), muted, loop, controls (on by default), and start to begin at a specific second — handy for pointing at one moment inside a longer clip. Size presets cover the common cases, or use the responsive snippet that scales to its container.
The distinctive part is domain restriction. Each embed can carry an allowlist of domains where it may play, enforced by the browser through the standard Content-Security-Policy: frame-ancestors header. Copy-pasting the snippet elsewhere still happens — but on a site not on the list, the browser simply refuses to render the iframe. Precedence is simple: a per-share allowlist wins, otherwise a tenant-wide default applies, and if neither is set the embed plays anywhere — fine for public content, intentional for everything else.
How it works
You can generate an embed interactively from the asset page, or programmatically. The API exposes it per asset:
POST /v1/assets/{gaid}/embed— generate (or reuse) an embed code, with options for width, height, responsive snippet, playback flags, andallowed_domainsGET /v1/assets/{gaid}/embed— fetch the existing embed codeDELETE /v1/assets/{gaid}/embed— revoke it
Each embed is backed by a dedicated long-lived public share: it lasts a year and renews automatically whenever it comes within thirty days of expiring, so embeds on long-lived pages do not quietly die. Because the share is dedicated to embedding, revoking it kills that embed everywhere without touching the underlying asset or any of its other shares. The TypeScript SDK wraps this as client.embeds.get, create, and revoke.
Good to know
- Video only. Embeds work for assets with a
video/*MIME type; calling the embed endpoints on anything else returns a422. - Scopes: reading an embed requires
shares:read; creating or revoking one requiresshares:manage. - Embed shares are isolated from the regular shares surface — they do not appear in, and cannot be managed through, the standard
/v1/sharesendpoints. force_newrotates an embed: it revokes the existing embed share and mints a fresh one, invalidating the old snippet.
The full request and response shapes for the embed endpoints are in the API documentation. Want to generate a snippet against a real library first? Try the demo.