ReelPrefetchController class
Controls video prefetching based on scroll position. Limits concurrent downloads and manages download lifecycle. Uses NetworkQualityMonitor for adaptive prefetching configuration.
Constructors
- ReelPrefetchController({int? maxConcurrent})
-
factory
Properties
- config → PrefetchConfig
-
Get current prefetch configuration based on network
Uses NetworkQualityMonitor if no manual override is set
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxConcurrent ↔ int
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancelAll(
) → void - Cancel all downloads.
-
cancelDownload(
String url) → void - Cancel download for a URL.
-
dispose(
) → void - Clean up resources.
-
getPlayablePath(
String url, {Map< String, String> ? headers}) → Future<String> - Get playable path for a video URL. Waits for minimum bytes if file is empty/small, then returns path. Download continues in background after path is returned. Automatically detects and handles HLS (.m3u8) URLs.
-
getProgress(
String url) → Future< double> - Get download progress (0.0 to 1.0).
-
isCached(
String url) → Future< bool> - Check if video is fully cached.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onScrollUpdate(
{required List< String> urls, required int currentIndex, int? prefetchCount, int? prefetchBehind, int? keepRange, Map<String, String> ? headers}) → void - Update prefetch based on current scroll position. Cancels downloads far from current, starts prefetch for next/previous videos. Uses network-adaptive configuration for prefetch counts.
-
setNetworkType(
NetworkType? type) → void - Manually override the network type for adaptive prefetching Pass null to use automatic detection from NetworkQualityMonitor
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited