Skip to main content

Broadcast API

The createBroadcast function lets you send video to Daydream for real-time AI processing.

Basic Usage

The WHEP playback URL is returned in the WHIP response header livepeer-playback-url. The Browser SDK automatically captures this for you in broadcast.whepUrl after connecting.

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

This will:
  1. Close the WebRTC connection
  2. Set state to "ended"
  3. The whepUrl is no longer valid
Calling stop() doesn’t stop the MediaStream tracks. You should stop them separately if needed:

Complete Example

Next Steps