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.

StreamPixelApplication is the SDK entry point. It accepts a settings object and returns the core streaming instance plus helper utilities.

Signature

async function StreamPixelApplication(settings) => {
  pixelStreaming, appStream, queueHandler, UIControl, reconnectStream
}

Parameters

The settings object accepts the following properties:
ParameterTypeDefaultDescription
appIdstringRequiredProject ID from Streampixel dashboard
afktimeoutnumber120Idle timeout in seconds (1–7200)
AutoConnectbooleanfalseAuto-connect on initialization
fallBackCodecstringDashboard valueFallback video codec ("H264", "VP8", "VP9", "AV1")
fakeMouseWithTouchesbooleanfalseConvert touch events to mouse events
forceTurnbooleantrueForce TURN relay for NAT traversal
gamepadInputbooleantrueEnable gamepad/controller input
hoverMousebooleantrueSend mouse hover/move events to UE
keyBoardInputbooleantrueEnable keyboard input
maxBitratenumber100Maximum bitrate in Mbps
maxQPnumber-1Maximum quantization parameter (-1 = no limit)
maxStreamQualitystring"1080p (1920x1080)"Maximum allowed resolution preset
minBitratenumber1Minimum bitrate in Mbps
minQPnumber20Minimum quantization parameter (1–51)
mouseInputbooleantrueEnable mouse input
primaryCodecstringDashboard valuePreferred video codec ("H264", "VP8", "VP9", "AV1")
resolutionModestring"Fixed Resolution Mode""Fixed Resolution Mode", "Dynamic Resolution Mode", or "Crop on Resize Mode"
sfuHoststring"false"Set to "true" for SFU host mode
sfuPlayerstring"false"Set to "true" for SFU viewer mode
showResolutionbooleanDashboard valueEnable resolution UI control
startResolutionstring"1080p (1920x1080)"Starting resolution for desktop
startResolutionMobilestring"480p (854x480)"Starting resolution for mobile
startResolutionTabstring"720p (1280x720)"Starting resolution for tablet
streamerIdstringAuto-generated UUIDTarget specific streamer instance
touchInputbooleantrueEnable touch input
useCamerabooleantrueEnable camera input to UE
useMicbooleantrueEnable microphone input to UE
xrInputbooleantrueEnable WebXR (VR/AR) input

Return value

Returns an object with five properties:
{
  pixelStreaming,    // PixelStreaming — core streaming instance
  appStream,         // CustomApplication — DOM wrapper and lifecycle
  queueHandler,      // Function — register queue position callbacks
  UIControl,         // UIControllerNew — audio, resolution, stats helpers
  reconnectStream    // EventEmitter — reconnection state events
}
Returns null if the project’s URL validation fails (when the current origin is not in the project’s allowed URLs list). Returns {} if called more than once (singleton guard).

Singleton behavior

StreamPixelApplication can only be initialized once per page. Calling it a second time logs a warning and returns an empty object ({}). Reload the page to reinitialize.

URL validation

The SDK checks window.location.origin against the project’s validPathUrl list configured in the dashboard. If the origin doesn’t match, null is returned. localhost is always allowed for development.

Next steps

Configuration options

Detailed reference for every settings field, organized by category.

pixelStreaming API

Methods and events on the returned pixelStreaming instance.