Put an Eagle 3D Streaming stream in an iframe on your page. The Control Panel gives you the script; you paste it in and talk to the frame with messages.
The examples here are plain HTML, and the approach is identical in React, Angular, Vue or anything else — an iframe is an iframe.
Choose the app, choose a configuration, and copy the streaming iframe script. It already contains the URL for that app and configuration, so there is nothing to assemble by hand.
<html>
<head><title>Demo</title></head>
<body>
<div>
<!-- the copied iframe script goes here -->
</div>
</body>
</html>
The copied script already gives the iframe id="iframe_1",
which everything else on this page uses to address the frame, and
allowfullscreen, without which fullscreen does not work at all.
If your app uses the microphone, add
allow="microphone" to the tag yourself — the copied
script does not include it, and without it the browser never offers the
microphone to the frame. See choose the microphone.
Features API › Fullscreen: the same from your own page (iframe or Web SDK) or from your Unreal app, with demos and troubleshooting.
Your page shows the stream, and pressing play starts the app.
The frame tells your page how far along the session is, which is what lets you build
your own loading experience instead of the default one. Each step arrives as a
message whose type you can switch on:
window.addEventListener("message", function (e) {
// only listen to the stream itself: compare e.origin with your streaming domain
switch (e.data && e.data.type) {
case "session.queued": /* your loading screen; e.data.queuePosition */ break;
case "stream.playing": /* hide it */ break;
case "session.ending": /* your ending screen; e.data.message */ break;
}
});
Message type | What has happened |
|---|---|
session.queued | The viewer is waiting for a machine. Carries queuePosition, their place in the queue. |
session.hostFound, then session.hostReserved | A machine was found and held for the viewer. Sent together - treat them as one moment. |
build.acquiring, build.preparing | Your app is being copied, then prepared. Carry percent. |
stream.ready | Ready to play; the browser may be waiting for a click before it starts video. |
build.listening | Your app can receive data from your page. |
stream.playing | The video is playing. |
session.ending | The session is ending, for any reason; message says which. |
Every event, its fields and its order - including the queue position as it changes, progress, and how to tell a crash from a timeout - is on Your own loading and ending screens. A Web SDK page receives the very same events.
When the configuration has a start password, the stream shows its own password box before session.queued. If
your page covers the iframe with a loading screen, the viewer would never see that box, so the iframe tells your
page about it:
| Message | What has happened | What your page should do |
|---|---|---|
passwordRequested | The password box is on screen, waiting for the viewer. | Hide your loading screen (or move it aside) so the box can be seen. |
passwordAccepted | The password was right; the stream continues with session.queued. | Bring your loading screen back if you want. |
A configuration without a password never sends these two messages.
Two things an embedding page most often wants next: Controlling the stream for quality, resolution, fullscreen, mouse and keys, and Choose the microphone for letting the viewer pick an input device mid-session.
Messages go to the frame with postMessage, and a message to your
Unreal app must carry cmd: "sendMessageToStreamingBuild" or the frame will not
forward it. See sending and
receiving data for both directions, and
controlling the stream for quality,
resolution and fullscreen.
Two-way communication between your page and your Unreal application.
Last updated