startComposition method
Starts a Composition from a stage based on the configuration provided in the request.
A Composition is an ephemeral resource that exists after this operation returns successfully. Composition stops and the resource is deleted:
- When StopComposition is called.
- After a 1-minute timeout, when all participants are disconnected from the stage.
- After a 1-minute timeout, if there are no participants in the stage when StartComposition is called.
- When broadcasting to the IVS channel fails and all retries are exhausted.
- When broadcasting is disconnected and all attempts to reconnect are exhausted.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw PendingVerification.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
Parameter destinations :
Array of destination configuration.
Parameter stageArn :
ARN of the stage to be used for compositing.
Parameter idempotencyToken :
Idempotency token.
Parameter layout :
Layout object to configure composition parameters.
Parameter tags :
Tags attached to the resource. Array of maps, each of the form
string:string (key:value). See Best
practices and strategies in Tagging AWS Resources and Tag
Editor for details, including restrictions that apply to tags and "Tag
naming limits and requirements"; Amazon IVS has no constraints on tags
beyond what is documented there.
Implementation
Future<StartCompositionResponse> startComposition({
required List<DestinationConfiguration> destinations,
required String stageArn,
String? idempotencyToken,
LayoutConfiguration? layout,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'destinations': destinations,
'stageArn': stageArn,
'idempotencyToken': idempotencyToken ?? _s.generateIdempotencyToken(),
if (layout != null) 'layout': layout,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/StartComposition',
exceptionFnMap: _exceptionFns,
);
return StartCompositionResponse.fromJson(response);
}