concurrentAdd method

void concurrentAdd(
  1. HlsSegment hlsSegment,
  2. Map<String, String> headers
)

Adds a new HlsSegment to the segment list if not already present.

Implementation

void concurrentAdd(
  HlsSegment hlsSegment,
  Map<String, String> headers,
) {
  bool match = _list.where((e) => e.url == hlsSegment.url).isNotEmpty;
  if (!match) _list.add(hlsSegment);
}