getMediaForFragmentList method

Future<GetMediaForFragmentListOutput> getMediaForFragmentList({
  1. required List<String> fragments,
  2. String? streamARN,
  3. String? streamName,
})

Gets media for a list of fragments (specified by fragment number) from the archived data in an Amazon Kinesis video stream. For limits, see Kinesis Video Streams Limits.

  • x-amz-ErrorType HTTP header – contains a more specific error type in addition to what the HTTP status code provides.
  • x-amz-RequestId HTTP header – if you want to report an issue to Amazon Web Services, the support team can better diagnose the problem if given the Request Id.
Both the HTTP status code and the ErrorType header can be utilized to make programmatic decisions about whether errors are retry-able and under what conditions, as well as provide information on what actions the client programmer might need to take in order to successfully try again.

For more information, see the Errors section at the bottom of this topic, as well as Common Errors.

May throw ClientLimitExceededException. May throw InvalidArgumentException. May throw NotAuthorizedException. May throw ResourceNotFoundException.

Parameter fragments : A list of the numbers of fragments for which to retrieve media. You retrieve these values with ListFragments.

Parameter streamARN : The Amazon Resource Name (ARN) of the stream from which to retrieve fragment media. Specify either this parameter or the StreamName parameter.

Parameter streamName : The name of the stream from which to retrieve fragment media. Specify either this parameter or the StreamARN parameter.

Implementation

Future<GetMediaForFragmentListOutput> getMediaForFragmentList({
  required List<String> fragments,
  String? streamARN,
  String? streamName,
}) async {
  final $payload = <String, dynamic>{
    'Fragments': fragments,
    if (streamARN != null) 'StreamARN': streamARN,
    if (streamName != null) 'StreamName': streamName,
  };
  final response = await _protocol.sendRaw(
    payload: $payload,
    method: 'POST',
    requestUri: '/getMediaForFragmentList',
    exceptionFnMap: _exceptionFns,
  );
  return GetMediaForFragmentListOutput(
    payload: await response.stream.toBytes(),
    contentType:
        _s.extractHeaderStringValue(response.headers, 'Content-Type'),
  );
}