Skip to content

StreamLiveInputOutput

Source: src/Cloudflare/Stream/LiveInputOutput.ts

A Cloudflare Stream live input output — restreams (simulcasts) live video received by a StreamLiveInput to another RTMP(S) destination such as YouTube Live or Twitch.

The destination (url + streamKey) is immutable: Cloudflare’s update endpoint only toggles enabled, so changing the destination replaces the output. Toggling enabled updates the output in place.

Requires the Stream subscription to be enabled on the account.

const input = yield* Cloudflare.StreamLiveInput("Broadcast", {});
const youtube = yield* Cloudflare.StreamLiveInputOutput("YouTube", {
liveInputId: input.liveInputId,
url: "rtmps://a.rtmps.youtube.com/live2",
streamKey: youtubeStreamKey,
});
const youtube = yield* Cloudflare.StreamLiveInputOutput("YouTube", {
liveInputId: input.liveInputId,
url: "rtmps://a.rtmps.youtube.com/live2",
streamKey: youtubeStreamKey,
enabled: false,
});