Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt

Use this file to discover all available pages before exploring further.

The pixelStreaming object is the core streaming instance returned by StreamPixelApplication().

Methods

addEventListener(event, callback)

Register a listener for WebRTC lifecycle events.
pixelStreaming.addEventListener('webRtcConnected', () => { });

connect()

Manually initiate a connection (use when AutoConnect is false).
You only need to call connect() when AutoConnect is set to false. If AutoConnect is true, the connection is established automatically on initialization.
pixelStreaming.connect();

disconnect()

Disconnect the stream.
pixelStreaming.disconnect();

reconnect()

Reconnect after a disconnect.
pixelStreaming.reconnect();

emitConsoleCommand(command)

Send a console command to Unreal Engine.
ParameterTypeDescription
commandstringUE console command
pixelStreaming.emitConsoleCommand('stat fps');
pixelStreaming.emitConsoleCommand('r.SetRes 1920x1080f');

addResponseEventListener(name, callback)

Listen for custom responses sent from UE to the web application.
ParameterTypeDescription
namestringListener name (e.g., 'handle_responses')
callbackfunctionCalled with the response string
pixelStreaming.addResponseEventListener('handle_responses', (response) => {
  const data = JSON.parse(response);
});

unmuteMicrophone(enabled)

Enable or disable microphone input to UE.
ParameterTypeDescription
enabledbooleantrue to enable, false to disable
pixelStreaming.unmuteMicrophone(true);

unmuteCamera(enabled)

Enable or disable camera input to UE.
ParameterTypeDescription
enabledbooleantrue to enable, false to disable
pixelStreaming.unmuteCamera(true);

Events

Connection lifecycle

EventWhen it fires
webRtcAutoConnectAuto-connect initiated
webRtcConnectingPeer connection being established
webRtcSdpSDP offer/answer exchanged
webRtcConnectedPeer connection established
streamLoadingVideo data arriving
playStreamVideo about to start playback

Failure

EventWhen it fires
webRtcFailedConnection failed to establish
webRtcDisconnectedEstablished connection dropped

AFK

EventDataDescription
afkWarningActivatee.data.countDown, e.data.dismissAfkWarning shown. countDown = seconds remaining, dismissAfk = function to dismiss
afkWarningUpdatee.data.countDownCountdown updated (every second)
afkWarningDeactivateUser interacted, warning dismissed
afkTimedOutSession ended due to inactivity

Statistics

EventDataDescription
statsReceivede.data.aggregatedStatsStream statistics available. Contains inboundVideoStats, inboundAudioStats, sessionStats, codecs

Next steps

UIControl API

Audio, resolution, and stats helper methods.

reconnectStream API

Listen to reconnection state changes.