cancel static method

void cancel(
  1. String url
)

Cancel HLS download.

Implementation

static void cancel(String url) {
  final state = _downloads[url];
  if (state != null) {
    state.cancelled = true;
    state.activeSegmentSub?.cancel();
    if (state.activeSegmentUrl != null) {
      ProgressiveDownloader.cancel(state.activeSegmentUrl!);
    }
    state.refreshTimer?.cancel();
    _downloads.remove(url);
  }
}