getStream method

Stream<List<int>> getStream(
  1. StreamInfo streamInfo, {
  2. Map<String, String> headers = const {},
  3. bool validate = true,
  4. int start = 0,
  5. int errorCount = 0,
  6. required StreamClient streamClient,
})

Implementation

Stream<List<int>> getStream(
  StreamInfo streamInfo, {
  Map<String, String> headers = const {},
  bool validate = true,
  int start = 0,
  int errorCount = 0,
  required StreamClient streamClient,
}) {
  if (streamInfo.fragments.isNotEmpty) {
    // DASH(fragmented) stream
    return _getFragmentedStream(
      streamInfo,
      headers: headers,
      validate: validate,
      start: start,
      errorCount: errorCount,
    );
  }
  if (streamInfo is HlsStreamInfo) {
    return _getHlsStream(streamInfo);
  }
  // Normal stream
  return _getStream(
    streamInfo,
    streamClient: streamClient,
    headers: headers,
    validate: validate,
    start: start,
    errorCount: errorCount,
  );
}