GetStream
Source:
src/AWS/IVS/GetStream.ts
Runtime binding for ivs:GetStream.
Reads the bound Channel’s active (live) stream — state, health,
viewer count, and playback URL. Fails with the typed
ChannelNotBroadcasting tag when the channel is not live. The channel
ARN is injected from the binding. Provide the implementation with
Effect.provide(AWS.IVS.GetStreamHttp).
Monitoring Live Streams
Section titled “Monitoring Live Streams”// init — bind the operation to the channelconst getStream = yield* AWS.IVS.GetStream(channel);
// runtimeconst live = yield* getStream().pipe( Effect.map(({ stream }) => ({ live: true, viewers: stream?.viewerCount })), Effect.catchTag("ChannelNotBroadcasting", () => Effect.succeed({ live: false, viewers: 0 }), ),);