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.
Parameter Type Description 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.
Parameter Type Description 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.
Parameter Type Description enabledbooleantrue to enable, false to disable
pixelStreaming . unmuteMicrophone ( true );
unmuteCamera(enabled)
Enable or disable camera input to UE.
Parameter Type Description enabledbooleantrue to enable, false to disable
pixelStreaming . unmuteCamera ( true );
Events
Connection lifecycle
Event When 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
Event When it fires webRtcFailedConnection failed to establish webRtcDisconnectedEstablished connection dropped
AFK
Event Data Description afkWarningActivatee.data.countDown, e.data.dismissAfkWarning shown. countDown = seconds remaining, dismissAfk = function to dismiss afkWarningUpdatee.data.countDownCountdown updated (every second) afkWarningDeactivate— User interacted, warning dismissed afkTimedOut— Session ended due to inactivity
Statistics
Event Data Description 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.