video_pool library

Enterprise video orchestration for Flutter.

Provides intelligent controller pooling with instance reuse, visibility-based lifecycle management, thermal throttling, disk caching, and ready-to-use widgets.

Classes

AudioFocusManager
Manages system audio focus and app lifecycle pause/resume behavior.
BandwidthEstimator
Estimates network bandwidth using Exponential Moving Average (EMA) from prefetch download durations.
BandwidthSampleEvent
A bandwidth measurement sample from a completed download.
BandwidthThresholds
Bandwidth thresholds for network-aware preload adjustment.
CachedFile
Metadata for a cached video file on disk.
CacheEvent
Emitted on disk cache interactions (hit, miss, evict, prefetch complete).
DecoderBudget
Abstract interface for decoder budget management.
DefaultLifecyclePolicy
Default lifecycle policy for feed-style video playback.
DeviceCapabilities
Describes the hardware capabilities of the current device.
DeviceMonitor
Default VideoPoolPlatform implementation backed by platform channels.
DeviceStatus
A snapshot of current device health reported by the native platform.
EmergencyFlushEvent
Emitted when an emergency memory flush disposes all non-primary players.
ErrorEvent
Emitted when an error occurs within the pool or one of its subsystems.
FilePreloadManager
Manages pre-fetching video data to disk so that the player can open local files instead of streaming from the network.
GlobalDecoderBudget
Default implementation using a fixed global token budget.
LifecycleEvent
Emitted when a pool entry transitions between lifecycle states.
LifecycleOrchestrator
The reconciliation engine that decides what each player slot should do.
LifecyclePolicy
Strategy interface for lifecycle reconciliation logic.
LruCache<K, V>
A generic Least Recently Used (LRU) cache.
MediaKitAdapter
A PlayerAdapter implementation backed by media_kit.
MemoryManager
Manages memory tracking and eviction for the video pool.
MetricsSnapshot
A point-in-time metrics summary computed lazily from an EventRingBuffer.
PlaybackConfig
Configuration for video playback behavior.
PlayerAdapter
Abstract interface for a video player instance.
PlayerState
Immutable snapshot of a player's current state.
PoolEntry
Wraps a single pooled PlayerAdapter with lifecycle metadata.
PoolEvent
Base class for all pool events.
PoolStatistics
Debug metrics for a VideoPool instance.
PredictionEvent
Emitted when the predictive scroll engine makes or resolves a prediction.
PredictionResult
The result of a scroll destination prediction.
PredictiveScrollEngine
A stateless, pure-math engine that predicts where a scroll will stop.
ReconcileEvent
Emitted after the orchestrator completes a reconciliation pass.
ReconciliationPlan
The result of a lifecycle reconciliation pass.
SwapEvent
Emitted when a player instance swaps its media source to a new index.
ThrottleEvent
Emitted when thermal or memory conditions cause the pool to throttle.
ThumbnailExtractor
Extracts thumbnail images from cached video files.
TokenEvent
Base class for all token-related events in the decoder budget system.
TokenGrantedEvent
Emitted when tokens are released back to the budget, making them available for other pools.
TokenRequestEvent
Emitted when a pool requests tokens from the decoder budget.
TokenRevokedEvent
Emitted when tokens are revoked from a pool due to budget reduction.
VideoCard
Individual video widget with full lifecycle management.
VideoErrorWidget
Error UI shown when a video fails to load or play.
VideoFeedView
TikTok/Reels style full-screen vertical video feed.
VideoListView
Instagram-style mixed content list with video support.
VideoOverlay
Overlay shown on top of the video surface for play/pause controls and loading indicators.
VideoPool
The central video pool coordinator.
VideoPoolConfig
Configuration for a VideoPool instance.
VideoPoolLogger
Logging utility for the video pool.
VideoPoolPlatform
Abstract interface for native device monitoring.
VideoPoolProvider
An InheritedWidget that exposes a VideoPool to the widget tree.
VideoPoolScope
A StatefulWidget that owns the lifecycle of a VideoPool.
VideoSource
Describes a video resource to be played.
VideoThumbnail
Placeholder widget shown before video playback begins.
VisibilityTracker
Computes intersection ratios for items in a scrollable list.
VisibilityUpdate
Result of a visibility computation.

Enums

CacheAction
Actions that can occur on a cache entry.
LifecycleState
The lifecycle state of a video slot within the pool.
LogLevel
Log verbosity level for VideoPoolLogger.
MemoryPressureLevel
Categorizes system memory pressure into actionable levels.
PlaybackPhase
The phase of a player's playback lifecycle.
ResolutionHint
Hint about expected video resolution for memory estimation.
ThermalLevel
Device thermal level reported by the OS.
VideoSourceType
The type of video source.

Typedefs

EffectiveLimits = ({int maxConcurrent, int memoryBudget, int preloadCount})
Effective resource limits computed from config + device conditions.
EvictionCallback<K, V> = void Function(K key, V value)
A callback invoked when an entry is evicted from the cache.
VideoSourceResolver = VideoSource? Function(int index)
Callback to resolve a video index to its VideoSource.