CachedVideoPlayerPlus는 영상의 지속적인 캐싱을 추가하여 표준 video_player 플러그인을 강화합니다. 이후 재시청 시 더 빠른 재생을 보장합니다. 앱 세션 간에 이전에 재생한 영상을 기억하여 로드 시간과 대역폭 사용량을 줄입니다. 신뢰성과 성능을 고려해 설계되었으며 Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원합니다. 오프라인 영상 접근 또는 콘텐츠 반복 재생이 필요한 앱에 적합합니다.
사용 사례
오프라인 비디오 재생
비디오 다시 보기 속도 향상
데이터 사용량 감소
로컬 캐시를 사용한 스트리밍
앱 재개 연속성
미디어 집약형 애플리케이션
주요 기능
지속적인 비디오 캐싱
세션 간 비디오 메모리
로드 성능 향상
다중 플랫폼 지원
대역폭 효율적인 재생
일시 정지 후 원활한 재개
적합한 대상
비디오 수업이 포함된 교육 앱
팟캐스트 또는 미디어 스트리밍 앱
오프라인 우선 비디오 애플리케이션
영상 재시청률이 높은 앱
신뢰할 수 있는 비디오 캐싱을 찾는 개발자
고려 사항
시간이 지남에 따라 증가하는 저장 사용량
대규모 라이브러리에 필요한 캐시 관리
매우 짧은 수명의 비디오 콘텐츠에 적합하지 않습니다
수동 캐시 삭제가 필요할 수 있습니다
초기 설정에서는 캐시 크기 제한에 주의해야 합니다
캐시 제거 정책에 대한 사용자 지정이 제한적
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
🧠 Created by the developer of Brink: Psychological Warfare
"Can you find the sweet spot between bold and delusional?"
Support the maintenance of this package by checking out my latest indie game!
Cached Video Player Plus
The video_player plugin that went to therapy, worked on its commitment issues,
and now actually remembers your videos! 🧠
Powered by the magic of flutter_cache_manager - because buffering wheels are
so 2010.
Like video_player, but with a photographic memory and trust issues with the
internet. 📹✨
Cache videos seamlessly for offline playback 🚀 Zero buffering on repeat views(your users will love you for this!) Drop-in replacement for video_player(well, mostly - see migration
guide!) 📱 Cross-platform support(Android, iOS, macOS, Web*, Linux*, Windows*)
💝 Support the Project
If this package saved you from the eternal spinning wheel of video buffering,
consider buying me a coffee! ☕
Every coffee helps fuel late-night coding sessions and the occasional
existential crisis about naming variables. 🤔☕
✨ What's New in v4
We Marie Kondo'd the entire API! Everything that didn't spark joy got yeeted
into the digital void! ✨🗑️
Cleaner API: Less boilerplate, more magic
Pre-caching: Cache videos before you even need them
Custom cache keys: Because URLs are overrated
Better migration: Your v3 cache won't vanish into the void
More humor: 42% funnier error messages
[!CAUTION]
🚨 BREAKING CHANGES AHEAD!
Version 4 introduces a total API restructuring, adding new features while
maintaining all functionality. These changes introduce major breaking changes.
Migrating from v3.x.x?
Don't panic! We've got you covered. Check out our 📖 Migration Guide -
it's actually entertaining to read and includes:
Complete API reference changes
Step-by-step migration instructions
Common issues and solutions
😂 Memes and jokes(because migration should be fun!)
📱 Live Demos
See cached_video_player_plus in action across different platforms:
Basic Playback (Android)
Chewie Integration (iOS)
Pre-Caching (macOS)
Advanced Cache Management (Windows)
🚀 Quick Start
1. Add to pubspec.yaml
dependencies:cached_video_player_plus:^4.1.0video_player:^2.10.1# Don't forget this one!
Follow the instructions in the respective package documentation to set up
playback.
Web Platform Notes
Web doesn't support file caching (because browser security is a party pooper
🎉🚫), but you can hack around it:
final player = CachedVideoPlayerPlus.networkUrl(
Uri.parse('https://example.com/video.mp4'),
httpHeaders: {
'Cache-Control': 'max-age=80085', // Time-tested cache duration
},
);
WASM Support ✨
Flutter's WebAssembly (WASM) compilation is now supported! To use WASM
compilation, you'll need to override the get_storage dependency since the
original doesn't support WASM (because some packages are like that one friend
who refuses to upgrade their phone):
Cache videos before your users even know they want them! (Mind reader
level: 100)
// Pre-cache a video for instant playback laterawaitCachedVideoPlayerPlus.preCacheVideo(
Uri.parse('https://example.com/next-video.mp4'),
invalidateCacheIfOlderThan: constDuration(days: 42),
);
Custom Cache Keys
Because sometimes URLs are longer than a CVS receipt:
final player = CachedVideoPlayerPlus.networkUrl(
Uri.parse('https://example.com/super-long-url-with-tokens.mp4?v=123456'),
cacheKey: 'my_awesome_video', // Much cleaner!
);
Cache Management
Take control of your cache like a digital Marie Kondo:
// Remove specific video from cacheawaitCachedVideoPlayerPlus.removeFileFromCache(
Uri.parse('https://example.com/video.mp4'),
);
// Remove by custom cache keyawaitCachedVideoPlayerPlus.removeFileFromCacheByKey('my_awesome_video');
// Nuclear option: clear everythingawaitCachedVideoPlayerPlus.clearAllCache(); // *POOF* 💨
🚨 Known Issues (aka "It's not a bug, it's a feature!")
1. flutter_cache_manager Override Required
If you're seeing cache files not deleting properly or multiple downloads of the
same video:
Root Cause: The flutter_cache_manager with the fixed bug is not yet
published on pub.dev, so we need to override it in our pubspec.yaml.
Solution: Add the following dependency override to your pubspec.yaml:
If your cached videos show up as .bin files instead of proper video files,
here's the community-tested workaround:
Root Cause: The issue occurs when servers don't provide proper
Content-Type headers for video files, causing flutter_cache_manager to save
them with generic .bin extensions.
Solution: Override the file extension in your flutter_cache_manager
configuration: