Broadcast API
ThecreateBroadcast function lets you send video to Daydream for real-time AI processing.
Basic Usage
Configuration Options
State Machine
The broadcast goes through these states:Events
Replace Stream
You can swap the video source while broadcasting (e.g., switch from camera to screen share):Adjust Framerate
Dynamically change the max framerate:Stop Broadcasting
- Close the WebRTC connection
- Set state to
"ended" - The
whepUrlis no longer valid
Calling
stop() doesn’t stop the MediaStream tracks. You should stop them separately if needed:Complete Example
Next Steps
- Player - Play the AI-processed output
- React Hooks - Use
useBroadcasthook - Compositor - Combine multiple sources