precache static method
Pre-caches the video at the specified url.
url: The video URL to be pre-cached.
headers: Optional HTTP headers for the request.
cacheSegments: Number of segments to cache (default: 2).
downloadNow: If true, downloads segments immediately; if false, pushes to the queue (default: true).
progressListen: If true, returns a StreamController with progress updates (default: false).
Returns a StreamController emitting progress/status updates, or null if not listening.
Implementation
static Future<StreamController<Map>?> precache(
String url, {
Map<String, Object>? headers,
int cacheSegments = 2,
bool downloadNow = true,
bool progressListen = false,
}) {
return UrlParserFactory.createParser(url.toSafeUri())
.precache(url, headers, cacheSegments, downloadNow, progressListen);
}