createRecordingConfiguration method

Future<CreateRecordingConfigurationResponse> createRecordingConfiguration({
  1. required DestinationConfiguration destinationConfiguration,
  2. String? name,
  3. int? recordingReconnectWindowSeconds,
  4. RenditionConfiguration? renditionConfiguration,
  5. Map<String, String>? tags,
  6. ThumbnailConfiguration? thumbnailConfiguration,
})

Creates a new recording configuration, used to enable recording to Amazon S3.

Known issue: In the us-east-1 region, if you use the Amazon Web Services CLI to create a recording configuration, it returns success even if the S3 bucket is in a different region. In this case, the state of the recording configuration is CREATE_FAILED (instead of ACTIVE). (In other regions, the CLI correctly returns failure if the bucket is in a different region.)

Workaround: Ensure that your S3 bucket is in the same region as the recording configuration. If you create a recording configuration in a different region as your S3 bucket, delete that recording configuration and create a new one with an S3 bucket from the correct region.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw PendingVerification. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter destinationConfiguration : A complex type that contains a destination configuration for where recorded video will be stored.

Parameter name : Recording-configuration name. The value does not need to be unique.

Parameter recordingReconnectWindowSeconds : If a broadcast disconnects and then reconnects within the specified interval, the multiple streams will be considered a single broadcast and merged together. Default: 0.

Parameter renditionConfiguration : Object that describes which renditions should be recorded for a stream.

Parameter tags : Array of 1-50 maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.

Parameter thumbnailConfiguration : A complex type that allows you to enable/disable the recording of thumbnails for a live session and modify the interval at which thumbnails are generated for the live session.

Implementation

Future<CreateRecordingConfigurationResponse> createRecordingConfiguration({
  required DestinationConfiguration destinationConfiguration,
  String? name,
  int? recordingReconnectWindowSeconds,
  RenditionConfiguration? renditionConfiguration,
  Map<String, String>? tags,
  ThumbnailConfiguration? thumbnailConfiguration,
}) async {
  _s.validateNumRange(
    'recordingReconnectWindowSeconds',
    recordingReconnectWindowSeconds,
    0,
    300,
  );
  final $payload = <String, dynamic>{
    'destinationConfiguration': destinationConfiguration,
    if (name != null) 'name': name,
    if (recordingReconnectWindowSeconds != null)
      'recordingReconnectWindowSeconds': recordingReconnectWindowSeconds,
    if (renditionConfiguration != null)
      'renditionConfiguration': renditionConfiguration,
    if (tags != null) 'tags': tags,
    if (thumbnailConfiguration != null)
      'thumbnailConfiguration': thumbnailConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/CreateRecordingConfiguration',
    exceptionFnMap: _exceptionFns,
  );
  return CreateRecordingConfigurationResponse.fromJson(response);
}