End the session

Finish the stream on purpose: when a tour ends, a configuration is done, or the viewer presses Exit. The machine is released at once, so you stop using minutes instead of waiting for an idle timeout.

At a glance

Triggered fromWhat you callWorks on the production player today
iframeno message on the production player; remove the iframe (or set its src to about:blank)Yes, by removing the frame
Web SDKe3ds_controller.terminate()Yes
Unrealthe plugin's E3DS Force End Session node, or {"cmd":"ForceEndSession"}Yes

How the calls travel

The Web SDK and the app end the session through the player. An iframe page ends it by closing the connection: when the viewer's player disconnects, the server shuts the app down.

Demos

iframe

The iframe demo's Terminate stream is dimmed on production: it uses the message that is not there yet.

Web SDK

Web SDK demo: Terminate stream. Demo manual.

How to do it

iframe

There is no "end" message on the production player yet. What works today: remove the frame, or point it at a blank page. The player disconnects, and the server shuts the app down and releases the machine.

document.getElementById("e3ds").src = "about:blank";
// or: document.getElementById("e3ds").remove();

When the app ends the session, your page receives a sessionEnding message (and the same again under its older name, redirectingWithMessage). Why a session ended.

Web SDK

document.getElementById("myExitButton").addEventListener("click", function () {
  e3ds_controller.terminate();
});

Nothing reconnects on its own afterwards. To stream again, start a new session with e3ds_controller.main(...).

Unreal

With the E3DS Features plugin: add BP_E3DS_PS_Actor to your level and call E3DS Force End Session. The viewer's page shows Session Ended.

Without the plugin: add a PixelStreamingInput component to an actor and send this with Send Pixel Streaming Response:

{"cmd":"ForceEndSession"}

Closing the tab instead: {"cmd":"ForeceEndTab"} (spelt with the extra e). Browsers usually refuse to close a tab the viewer opened, and then the stream keeps running. More on both.

Troubleshooting

What you seeWhyWhat to do
From the iframe, nothing endsThere is no end message on the production player.Remove the frame or set its src to about:blank.
ForeceEndTab shows "Scripts may close only the windows that were opened by them"The browser refused to close a tab the viewer opened.Use ForceEndSession.
No E3ds PS actor found on screenBP_E3DS_PS_Actor is not in the level.Add it.
The session ended but you did not end itA crash, the time limit or the idle timeout.Why a session ended.

Last updated