| 1 | import type * as ivsrealtime from "@distilled.cloud/aws/ivs-realtime"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Stage } from "./Stage.ts"; |
| 5 | |
| 6 | /** The `stageArn` is injected by the binding from the bound stage. */ |
| 7 | export interface StartCompositionRequest extends Omit< |
| 8 | ivsrealtime.StartCompositionRequest, |
| 9 | "stageArn" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Start a server-side composition of the bound stage — IVS mixes the |
| 14 | * stage's participants into a single video according to the `layout` and |
| 15 | * delivers it to the given `destinations` (an IVS low-latency channel |
| 16 | * and/or an S3 storage configuration). |
| 17 | * |
| 18 | * ### Compositing a Stage |
| 19 | * **Example:** Composite a stage into an IVS channel |
| 20 | * ```typescript |
| 21 | * // init |
| 22 | * const startComposition = yield* IVSRealtime.StartComposition(stage); |
| 23 | * |
| 24 | * // runtime |
| 25 | * const { composition } = yield* startComposition({ |
| 26 | * destinations: [{ channel: { channelArn } }], |
| 27 | * layout: { grid: { videoAspectRatio: "VIDEO" } }, |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface StartComposition extends Binding.Service< |
| 34 | StartComposition, |
| 35 | "AWS.IVSRealtime.StartComposition", |
| 36 | ( |
| 37 | stage: Stage, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: StartCompositionRequest, |
| 41 | ) => Effect.Effect< |
| 42 | ivsrealtime.StartCompositionResponse, |
| 43 | ivsrealtime.StartCompositionError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | export const StartComposition = Binding.Service<StartComposition>( |
| 48 | "AWS.IVSRealtime.StartComposition", |
| 49 | ); |