Frontend Controls
This page shows you how to interact with a running Streampixel session from your frontend—muting audio, changing resolution, reading stats, or sending custom messages to Unreal.
Frontend Controls
Everything happens through the objects returned by StreamPixelApplication():
pixelStreaming
Core WebRTC connection (connect / disconnect / events)
appStream
DOM wrapper for the video element, plus input helpers
UIControl
High-level runtime utilities (audio, resolution, stats, etc.)
queueHandler
Callback that reports the user’s queue position (if enabled)
🚦 Access Patterns
Create your React (or other framework) component and import the SDK as shown:
let pixelStreaming; // store globally or in React ref
let UIControl; // store globally or in React ref
const { appStream, pixelStreaming: ps, UIControl: ui } =
await StreamPixelApplication({ appId: "<id>", AutoConnect: true });
pixelStreaming = ps;
UIControl = ui;🔑 Common Runtime Actions
Mute / un-mute audio
UIControl.toggleAudio();
Enable microphone (browser permission needed)
await navigator.mediaDevices.getUserMedia({audio:true}); pixelStreaming.unmuteMicrophone(true);
Change stream resolution
UIControl.handleResMax("1280x720");
Get supported resolutions
const list = UIControl.getResolution();
Read live stats (FPS, bitrate, res)
const stats = UIControl.getStreamStats();
Send a custom UI message to Unreal
appStream.stream.emitUIInteraction({ message:{ type:"setColor", value:"#ff6600" } });
Handle messages back from Unreal
pixelStreaming.addResponseEventListener("handle_responses", (data)=>console.log(data));
Disconnect the session
pixelStreaming.disconnect();
Get stream stats
const stats = UIControl.getStreamStats(); console.log(stats);
Turn on Browser Mouse Visibility (Runtime)
UIControlApp.toggleHoveringMouse(true)
Turn off Browser Mouse Visibility (Runtime)
UIControlApp.toggleHoveringMouse(false)
🖥️ Example: Building a Mini Control Panel (React)
🖥️ Example: Building a Mini Control Panel (React)
If your project uses queueing, register a handler:
Last updated