pixelStreaming object is the core streaming instance returned by StreamPixelApplication().
Methods
addEventListener(event, callback)
Register a listener for WebRTC lifecycle events.
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.disconnect()
Disconnect the stream.
reconnect()
Reconnect after a disconnect.
emitConsoleCommand(command)
Send a console command to Unreal Engine.
| Parameter | Type | Description |
|---|---|---|
command | string | UE console command |
addResponseEventListener(name, callback)
Listen for custom responses sent from UE to the web application.
| Parameter | Type | Description |
|---|---|---|
name | string | Listener name (e.g., 'handle_responses') |
callback | function | Called with the response string |
unmuteMicrophone(enabled)
Enable or disable microphone input to UE.
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | true to enable, false to disable |
unmuteCamera(enabled)
Enable or disable camera input to UE.
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | true to enable, false to disable |
Events
Connection lifecycle
| Event | When it fires |
|---|---|
webRtcAutoConnect | Auto-connect initiated |
webRtcConnecting | Peer connection being established |
webRtcSdp | SDP offer/answer exchanged |
webRtcConnected | Peer connection established |
streamLoading | Video data arriving |
playStream | Video about to start playback |
Failure
| Event | When it fires |
|---|---|
webRtcFailed | Connection failed to establish |
webRtcDisconnected | Established connection dropped |
AFK
| Event | Data | Description |
|---|---|---|
afkWarningActivate | e.data.countDown, e.data.dismissAfk | Warning shown. countDown = seconds remaining, dismissAfk = function to dismiss |
afkWarningUpdate | e.data.countDown | Countdown updated (every second) |
afkWarningDeactivate | — | User interacted, warning dismissed |
afkTimedOut | — | Session ended due to inactivity |
Statistics
| Event | Data | Description |
|---|---|---|
statsReceived | e.data.aggregatedStats | Stream statistics available. Contains inboundVideoStats, inboundAudioStats, sessionStats, codecs |
Next steps
UIControl API
Audio, resolution, and stats helper methods.
reconnectStream API
Listen to reconnection state changes.