removeDownload method

  1. @override
Future<bool> removeDownload(
  1. String url
)
override

Removes a downloaded video from the cache.

Implementation

@override
Future<bool> removeDownload(String url) async {
  try {
    final result = await methodChannel.invokeMethod<bool>('removeDownload', {
      'url': url,
    });

    // Close and remove the progress stream controller
    _closeProgressController(url);
    _closeInfoController(url);

    // Clear progress tracking
    _lastReportedProgress.remove(url);
    _lastReportedInfo.remove(url);

    return result ?? false;
  } catch (e) {
    debugPrint('Error removing download: $e');
    return false;
  }
}