Events handlers

How to recognize that the stream is ready?

The Arcware Pixel Streaming WebSDK exposes several event handlers that allow your web application to react to changes in the streaming lifecycle.

These handlers can be used to implement:

  • loading screens

  • queue interfaces

  • connection monitoring

  • error handling

  • session tracking

  • analytics and debugging

Event handlers are exposed on the PixelStreaming instance and are available to both:

Mode
Supported

ArcwareInit (UI integration)

CoreSetup (Headless integration)

Handlers are typically implemented using the .add() method.

Example:

PixelStreaming.someHandler.add((event) => {
  console.log(event);
});

Multiple listeners can be attached to the same handler.


VideoInitialized

Triggered when the video stream becomes available and the first frame starts rendering.

This event indicates that:

  • the WebRTC connection is established

  • the stream is active

  • rendering has started

Typical uses:

  • hide loading overlays

  • start UI timers

  • enable UI controls

  • begin analytics tracking

Example:

Example usage:


queueHandler

Triggered when the user enters or moves within the Arcware streaming queue.

The queue is used when all streaming instances are currently occupied.

Instead of immediately launching a new instance, the user is placed in a queue until a streaming slot becomes available.

This handler allows applications to display custom queue interfaces.

Example:

Queue payload:

Meaning of the fields:

Field
Type
Description

type

"queue"

Identifies the message as a queue event

queue.index

number | undefined

Current position in queue, zero-based

queue.queueLength

number | undefined

Total queue length

queue.waited

number | undefined

Time already waited

queue.estimatedWaitTime

number | null | undefined

Estimated remaining wait time

queue.averageWaitTime

number | null | undefined

Average wait time

queue.valueType

QueueValueType

Unit used for all time values

Example usage:

Example UI:

Typical queue lifecycle:

Example usage:


sessionIdHandler

Triggered when the streaming session receives a session identifier.

The session ID uniquely identifies the active streaming session.

This can be useful for:

  • analytics

  • logging

  • reconnect workflows

  • debugging

Example:

Example usage:


loveLetterHandler

Triggered when the backend sends a Love Letter describing the current connection stage.

These messages are status updates sent by the backend while the stream is being prepared.

They are especially useful for:

  • custom loading overlays

  • connection progress messaging

  • debugging startup issues

Example:

Love Letter payload:

Meaning of the fields:

Field
Type
Description

type

"letter"

Identifies the message as a Love Letter

reason

string

Human-readable status message. Starts with "LL: "

code

number

Numeric code representing the current loading or connection state

verbosity

number

Indicates how verbose or detailed the message is

Example usage:

Example UI:

These messages are commonly used to implement custom loading screens or connection progress indicators.


applicationResponseHandler

Triggered when Unreal Engine sends a response message to the browser.

This is the main mechanism used for bidirectional communication between the web UI and Unreal Engine.

Example:

Responses are typically strings but often contain serialized JSON.

Example:

Example UI:


websocketOnCloseHandler

Triggered when the WebSocket connection to the signalling server is closed.

This event indicates that the streaming session has ended or the connection has been interrupted.

Possible reasons include:

  • the user disconnected

  • the instance stopped

  • network connectivity issues

  • backend session termination

Example:

Typical usage:

This handler can be used to:

  • display reconnect options

  • redirect the user

  • show a connection lost screen

  • trigger cleanup logic


whiteLabellingChangedHandler

Triggered whenever white-labelling configuration is applied or updated.

White-labelling may be applied from different sources:

  • SDK configuration

  • backend-provided branding

  • URL-based configuration (?wl)

  • runtime updates

Example:

Typical usage:

This handler allows applications to react when branding settings change dynamically.


postInitSideEffectsHandler

Triggered after the WebSDK has completed its initial setup and post-initialization tasks.

This event occurs after the SDK has finished applying configuration and preparing the streaming environment.

Example:

Typical usage:

This handler is useful for:

  • initializing UI elements that depend on the SDK

  • starting custom analytics tracking

  • running post-initialization logic


fileTransferHandler

Triggered when Unreal Engine sends a file to the browser through the Pixel Streaming data channel.

This feature allows Unreal Engine to transfer files directly to the client.

Typical use cases include:

  • screenshot downloads

  • exporting generated assets

  • sending generated reports or data files

Example:

The received file information can be accessed through the WebSDK.

Core method:

The returned object typically contains:

UI Integration Behavior

When using the UI integration (ArcwareInit), the WebSDK automatically downloads incoming files for the user.

This means that files sent from Unreal Engine will appear as normal browser downloads without additional implementation.

Core Integration Behavior

When using CoreSetup, file handling must be implemented manually.

Core users can retrieve the incoming file and decide how to handle it.

Example: manual download

Core integrations can also use the built-in download helper to mirror the same behavior as the default UI integration:

Fully Custom File Handling

Core integrations are not limited to browser downloads.

Applications can:

  • parse the file contents

  • open custom dialogs

  • display previews

  • upload files to external servers

  • store files locally

  • process them programmatically

Example: uploading to an API endpoint

This allows the WebSDK to integrate with workflows such as:

  • asset pipelines

  • data exports

  • automated reporting

  • cloud storage uploads.


Using Multiple Handlers

Multiple handlers can be attached to the same event.

Example:

All registered handlers will be executed when the event occurs.


Typical Event Lifecycle

The following illustrates the typical order of events when starting a stream:

During the session:

These handlers allow developers to build fully custom streaming interfaces and control logic around the WebSDK.

Last updated