Developer documentation

Browser loader API

Mount options, controller methods, real commands and host events.

The browser global

Loading the generated /embed/v1.js script installs window.RapidEye. It is a browser global, not a package import. Load one RapidEye environment on each page.

MemberContract
versionThe string 1 for this loader.
originThe origin inferred from the loaded script URL.
mount(element, options)Creates an iframe in a DOM element and returns its controller. Remounting the same element destroys its previous controller.
get(element)Returns the existing controller or null. It does not mount an element or wait for the async loader.

A reusable browser loading helper

Mount options

OptionValueBehavior
experienceIdPublished experience UUID; required.Selects the experience.
grantA fresh server-signed string for private access; otherwise omitted or null.Delivered in the validated initialization message, not the iframe URL.
aspectRatioCSS aspect-ratio string; default 16 / 9.Initial wrapper ratio before runtime resize messages set its height.
minHeightFinite number of pixels, at least zero; default 0.Minimum wrapper height.
themeCompatibility value dark or light.Accepted but currently does not change presentation.

The wrapper fills its container width. Set the container layout in your own CSS. Unknown options do not create additional capabilities.

Controller methods

MemberBehavior
iframeThe created HTMLIFrameElement. Keep the wrapper permission and origin settings intact.
on(event, handler)Registers a handler and returns an unsubscribe function. Handlers receive the payload without protocol fields.
send(command, payload)Sends a validated host command to the hosted runtime. Invalid commands or payloads throw synchronously.
destroy()Removes the wrapper/frame and registered host listeners. Repeated calls are safe.

destroy is UI teardown, not a browser-task cancellation or data-deletion operation. A viewer should use Stop inside Chat when a task must end.

There are no controller play(), pause(), seek(), cancelTask() or getTranscript() methods. Use send for documented playback commands.

Commands

send commandPayloadCurrent behavior
play{}Requests playback; browser media policies still apply.
pause{}Pauses the video.
seek{ seconds: 12.5 }Seeks to a finite, nonnegative number of seconds.
ping{ id: a string }Produces a matching pong from the host bridge.
theme{ theme: dark or light }Accepted compatibility message; no current visual effect.
Observe setup and send supported controls
const embed = window.RapidEye.mount(document.querySelector('#player'), {
  experienceId: 'EXPERIENCE_ID',
  aspectRatio: '16 / 9',
  minHeight: 240,
});
const unsubscribe = embed.on('ready', ({ experienceId, revision }) => {
  console.log('Experience setup completed', experienceId, revision);
});
embed.on('pong', ({ id }) => console.log('Bridge reply', id));
// Connect these application functions to your own controls.
function pauseFromYourControls() {
  embed.send('pause', {});
}
function seekFromYourControls(seconds) {
  embed.send('seek', { seconds });
}
function pingFromYourControls(id) {
  embed.send('ping', { id });
}
// On teardown: unsubscribe(); embed.destroy();

Events

on eventPayloadMeaning
readyexperienceId, revision, capabilitiesViewer/bootstrap setup completed. Not a video-loaded event.
resizeheight in pixelsThe runtime reports height; the wrapper applies it automatically.
statestate, currentTime in secondsplaying or paused transition snapshot. Not a continuous timeupdate stream.
navigateurl, reasonReports external navigation already opened by the viewer interaction. Current shared viewer emits reason link.
errorcode, messageRuntime setup/session/bootstrap failure. Not a complete feed of every chat or media HTTP error.
pongidReply to a matching ping.

The protocol schema also accepts state ended and navigation reasons booking/sign_in, but current viewer presentation does not emit those values. Do not rely on them as completion signals.

hello is an internal handshake handled by the wrapper, not an application event. No host event exposes browser-task progress, task completion or chat transcripts.

Both sides validate sender origin, source window and payload shape. Unknown messages are dropped. navigate is an observation, not a cancelable interception hook.