flutter_cache_video_player library

Classes

AssetVideoSource
Flutter assets 来源;首次使用时自动抽取到临时目录并缓存。 Flutter asset media source; extracted to the temp directory on first use.
CacheConfig
缓存配置类,包含所有可调参数。 Cache configuration class containing all tunable parameters.
CacheIndexDB
缓存数据库单例,负责初始化 ToStore 及注册所有表结构。 Cache database singleton responsible for ToStore initialization and schema registration.
CacheRepository
缓存仓库,封装对 media_index 和 chunk_bitmap 表的 CRUD 操作。 Cache repository encapsulating CRUD operations on media_index and chunk_bitmap tables.
CancelCurrentCommand
取消当前下载命令。 Command to cancel the current download.
ChunkBitmap
分片位图模型,用位运算追踪每个分片的下载完成状态。 Chunk bitmap model tracking each chunk's completion status via bitwise operations.
ChunkCompleted
分片下载完成事件。 Chunk download completion event.
ChunkFailed
分片下载失败事件,包含错误信息和是否可重试。 Chunk download failure event carrying error details and retryability.
ChunkMerger
分片合并器,将多个 chunk 文件合并为单一 data.bin。 Chunk merger that consolidates multiple chunk files into a single data.bin.
ChunkProgress
分片下载进度事件,包含已下载字节和流数据。 Chunk download progress event carrying downloaded bytes and stream data.
DefaultVideoPlayer
高性能的默认视频播放器组件。
DefaultVideoPlayerSlotContext
传递给自定义槽位 builder 的上下文,提供控制器和当前样式。 Context passed to slot builders so callers can reuse controller and style.
DownloadChunkCommand
下载分片命令。 Command to download a chunk.
DownloadManager
下载管理器,负责任务调度、优先级队列、重试与合并。 Download manager handling task scheduling, priority queueing, retries, and chunk merging.
DownloadTask
分片下载任务数据类,包含下载所需的所有信息。 Chunk download task data class holding all information needed for a download.
DownloadWorkerPool
Isolate 工作线程池,管理 N 个长驻工作 Isolate。 Isolate worker pool managing N long-lived worker Isolates.
FileUtils
文件系统工具类,管理缓存目录与文件操作。 File system utility managing cache directories and file operations.
FileVideoSource
本地文件来源(绝对路径或 file:// URI),不走代理。 Local file media source (absolute path or file:// URI). Bypasses the proxy.
FlutterCacheVideoPlayer
插件主入口,负责初始化并协调所有层(数据库、下载、代理、播放、UI)。 Plugin main entry point responsible for initializing and coordinating all layers (DB, download, proxy, player, UI).
FlutterCacheVideoPlayerController
播放控制器,封装 NativePlayerController 并管理生命周期、事件监听和历史持久化。 Player controller wrapping NativePlayerController with lifecycle management, event listeners, and history persistence.
FlutterCacheVideoPlayerView
视频渲染组件,只负责显示视频画面和基本状态(加载/缓冲/错误)。 控制栏、进度条等由使用者自行实现。
HistoryRepository
播放历史仓库,管理断点续播位置的持久化。 History repository managing persistence of resume-playback positions.
MediaIndex
媒体索引模型,持久化一个视频/音频资源的元数据。 Media index model persisting metadata for a single video/audio resource.
MimeDetector
MIME 类型检测器,根据文件扩展名推断媒体类型。 MIME type detector that infers media type from file extension.
NetworkVideoSource
网络来源,走 HTTP 缓存代理。 Network-backed media source, eligible for the HTTP caching proxy.
PlatformDetector
平台检测工具类,提供统一的平台判断能力。 底层基于 UniversalPlatform,同时兼容原生与 Web。
PlatformPlayerFactory
平台播放工厂,根据来源决定是否走本地缓存代理。
PlaybackHistory
播放历史模型,记录用户上次播放位置均用于断点续播。 Playback history model recording last play position for resume support.
PlayerGradientMask
覆盖在视频画面顶部/底部的黑色渐变遮罩,用于确保纯白图标和文字的可读性。
PlayerIconButton
播放器控件中通用的圆形图标按钮。 点击具有按压缩放反馈与半透明描边,图标默认为纯白色、纤细的 Apple 风格。
PlayerScrubberSlider
播放器底部使用的极纤细滑动条。 支持播放进度、缓存进度以及拖动时的"小白点"滑块。
ProxyCacheServer
本地 HTTP 代理缓存服务器,基于 shelf 为播放器提供媒体流。 Local HTTP proxy cache server based on shelf, serving media streams to the player.
RangeHeader
HTTP Range 头解析器。 HTTP Range header parser.
ShutdownCommand
关闭工作 Isolate 命令。 Command to shut down the worker Isolate.
SizeFormatter
文件大小格式化工具,将字节数转为可读字符串。 File size formatter converting bytes to human-readable strings.
UrlHasher
URL 哈希工具,将 URL 转换为固定长度的 SHA256 摘要。 URL hashing utility that converts a URL to a fixed-length SHA256 digest.
VideoCoverFrame
视频封面候选帧。
VideoSource
描述一个视频 / 音频的来源。
WorkerCancelled
Worker 取消完成事件,表示取消操作已清理完毕。 Worker-cancelled event indicating the cancellation cleanup is done.
WorkerCommand
Worker 命令密封类,由主 Isolate 发送给工作 Isolate。 Sealed class for commands sent from the main Isolate to worker Isolates.
WorkerEvent
Worker 事件密封类,由工作 Isolate 发送给主 Isolate。 Sealed class for events sent from worker Isolates to the main Isolate.
WorkerReady
Worker 就绪事件,表示工作 Isolate 已初始化完成。 Worker-ready event indicating the worker Isolate has finished initialization.
XFile
A CrossFile is a cross-platform, simplified File abstraction.

Enums

AppPlatformType
应用平台类型枚举。 Enumeration of supported application platform types.
PlayState
播放状态枚举。 Playback state enumeration.
TaskPriority
任务优先级枚举,P0 最高,P3 最低。 Task priority enumeration: P0 is highest, P3 is lowest.