insertAdBreak method

Future<InsertAdBreakResponse> insertAdBreak({
  1. required String channelArn,
  2. required int durationSeconds,
})

Inserts an ad marker in the playlist for the specified channel and duration using the ad configuration associated with the channel.

Note: AWS Elemental MediaTailor (EMT), the service that handles ad requests, provides CloudWatch metrics to help you monitor the success or failure of each InsertAdBreak operation. See Monitoring AWS Elemental MediaTailor with Amazon CloudWatch metrics in the AWS Elemental MediaTailor User Guide for details on available metrics.

May throw AccessDeniedException. May throw ChannelNotBroadcasting. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter channelArn : ARN of the channel into which the ad break is inserted.

Parameter durationSeconds : Duration of the ad break, in seconds.

Implementation

Future<InsertAdBreakResponse> insertAdBreak({
  required String channelArn,
  required int durationSeconds,
}) async {
  _s.validateNumRange(
    'durationSeconds',
    durationSeconds,
    1,
    300,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'channelArn': channelArn,
    'durationSeconds': durationSeconds,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/InsertAdBreak',
    exceptionFnMap: _exceptionFns,
  );
  return InsertAdBreakResponse.fromJson(response);
}