ProductsServicesDocsPricingAboutContact Log in Sign up

Iframe Embed

Embed the FXPlayer on any page with a single <iframe> tag. Configure playback, CTAs, and rendering via URL parameters, or control the player dynamically with the postMessage API.

Basic embed

Set the video source with the src parameter. No JavaScript required.

<iframe
  src="https://cdn.impossible.io/support/embed.html?src=https://example.com/video.mp4"
  width="720" height="405"
  allow="fullscreen"
></iframe>

Autoplay (muted) with poster

Browsers require muted for autoplay. Set autoplay=1&muted=1 and add a poster image.

<iframe
  src="https://cdn.impossible.io/support/embed.html
    ?src=VIDEO_URL
    &autoplay=1
    &muted=1
    &poster=POSTER_URL"
  width="720" height="405"
  allow="autoplay; fullscreen"
></iframe>

CTA overlays via URL parameters

Add CTAs using dot-notation: cta.{id}.{property}=value. This example shows a promo banner at 2–6s and a subscribe button from 3s onward.

<iframe src="https://cdn.impossible.io/support/embed.html
  ?src=VIDEO_URL
  &cta.promo.content=<div style='...'>50% Off!</div>
  &cta.promo.start=2
  &cta.promo.end=6
  &cta.promo.position=center
  &cta.promo.dismissible=true
  &cta.sub.content=<div style='...'>Subscribe</div>
  &cta.sub.start=3
  &cta.sub.position=bottom
  &cta.sub.link=https://example.com/subscribe
  &cta.sub.dismissible=true"
  width="720" height="405"
  allow="fullscreen"
></iframe>

postMessage API

Send commands to the embed and receive events back. Use this for dynamic playback control, CTA injection, and analytics.

const iframe = document.getElementById('player-iframe');

// Playback
iframe.contentWindow.postMessage({ action: 'play' }, '*');
iframe.contentWindow.postMessage({ action: 'pause' }, '*');
iframe.contentWindow.postMessage({ action: 'seek', time: 30 }, '*');

// Volume
iframe.contentWindow.postMessage({ action: 'setVolume', volume: 0.5 }, '*');
iframe.contentWindow.postMessage({ action: 'mute' }, '*');

// Inject a CTA dynamically
iframe.contentWindow.postMessage({
  action: 'addCTA',
  id: 'promo',
  options: {
    content: '<div style="...">Limited Offer!</div>',
    startTime: 5,
    endTime: 15,
    position: 'center',
    dismissible: true,
  }
}, '*');

// Listen for events from the embed
window.addEventListener('message', (e) => {
  if (e.data?.source === 'fxplayer') {
    console.log(e.data.event, e.data.data);
  }
});

Impossible.io rendering

Embed a dynamically rendered video. Set projectId, movie, and optionally region and params.

<iframe
  src="https://cdn.impossible.io/support/embed.html
    ?projectId=YOUR-PROJECT-ID
    &movie=welcome-video
    &region=eu-west-1
    &params={"name":"Alex","company":"Acme"}"
  width="720" height="405"
  allow="fullscreen"
></iframe>

URL parameter reference

Video

ParameterDescription
srcVideo URL
format"mp4" | "hls" | "auto" (default: auto-detect)
posterPoster image URL
autoplay1 / 0 (default: 0, requires muted for most browsers)
muted1 / 0 (default: 0)
loop1 / 0 (default: 0)

Controls

ParameterDescription
controls1 / 0 (default: 1)
keyboard1 / 0 (default: 1)
autoHide1 / 0 (default: 1, hide controls during playback)
autoHideDelayMilliseconds before auto-hide (default: 3000)

Impossible.io rendering

ParameterDescription
projectIdProject ID
movieMovie name
regionRegion (e.g. "eu-west-1")
routingKeyRouting key for dedicated clusters
parallelParallel render count
paramsJSON object of render parameters

CTA overlays (dot-notation)

Use cta.{id}.{property} to configure overlays via URL parameters.

ParameterDescription
cta.{id}.contentHTML content string
cta.{id}.startStart time in seconds
cta.{id}.endEnd time in seconds (omit for persistent)
cta.{id}.position"center" | "top" | "bottom"
cta.{id}.dismissible"true" / "false"
cta.{id}.pauseOnShow"true" / "false"
cta.{id}.linkWraps content in a clickable link
cta.{id}.classNameAdditional CSS class

Alternatively, pass all CTAs as a JSON array: ctas=[{"id":"x","content":"...","startTime":5}]

postMessage commands (parent → embed)

ActionParameters
play
pause
stop
seektime: Number
setSrcurl: String, format: String
setVolumevolume: Number (0–1)
mute / unmute
enterFullscreen / exitFullscreen / toggleFullscreen
addCTAid: String, options: Object
removeCTA / showCTA / hideCTAid: String
setMovieprojectId: String, movie: String
setParamsparams: Object
setTokentoken: String
getState— (triggers a state event back)

postMessage events (embed → parent)

All events include source: "fxplayer".

EventData
ready
play / pause / ended
timeupdate{ time, duration }
volumechange{ volume, muted }
fullscreenchange{ fullscreen }
error{ message, code }
cta:show / cta:hide / cta:click{ id }
state{ playing, currentTime, duration, volume, muted, fullscreen }