getMediaForFragmentList method

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

Gets media for a list of fragments (specified by fragment number) from the archived data in an Amazon Kinesis video stream. The following limits apply when using the GetMediaForFragmentList API:

  • A client can call GetMediaForFragmentList up to five times per second per stream.
  • Kinesis Video Streams sends media data at a rate of up to 25 megabytes per second (or 200 megabits per second) during a GetMediaForFragmentList session.

Implementation

Future<GetMediaForFragmentListOutput> getMediaForFragmentList({
  required List<String> fragments,
  required String streamName,
}) async {
  ArgumentError.checkNotNull(fragments, 'fragments');
  ArgumentError.checkNotNull(streamName, 'streamName');
  _s.validateStringLength(
    'streamName',
    streamName,
    1,
    256,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'Fragments': fragments,
    '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'),
  );
}