Aus öffentlichen Paketdaten erstellte Orientierung.
CachedVideoPlayerPlus erweitert den Standard-VideoPlayer-Plugin durch dauerhaftes Caching von Videos, wodurch eine schnellere Wiedergabe bei nachfolgenden Ansichten gewährleistet wird. Es merkt sich zuvor abgespielte Videos über App-Sitzungen hinweg und verringert so Ladezeiten und Bandbreitenverbrauch. Für Zuverlässigkeit und Leistung optimiert, unterstützt es mehrere Plattformen wie Android, iOS, Web, macOS, Windows und Linux. Ideal für Apps, die Offline-Zugriff auf Videos oder häufige Wiederholungen von Inhalten erfordern.
Anwendungsfälle
Offline-Videowiedergabe
Schnelleres Nachschauen von Videos
Reduzierter Datennutzung
Streaming mit lokalem Cache
App-Wiederaufnahme-Kontinuität
medienintensive Anwendungen
Hauptmerkmale
Persistentes Video-Caching
Videomemory über Sitzungen hinweg
Verbesserte Ladeleistung
Multiplattformunterstützung
bandbreiteneffiziente Wiedergabe
Nahtloser Fortsetzung nach Pause
Geeignet für
Bildungsspiele mit Videolektionen
Podcast- oder Medien-Streaming-Apps
Offline-first-Videoumgebung
Apps mit hohen Video-Wiederholraten
Entwickler, die zuverlässiges Video-Caching suchen
Hinweise
Erhöhter Speicherplatzverbrauch im Laufe der Zeit
Cache-Management erforderlich für große Bibliotheken
Nicht geeignet für sehr kurzlebige Videoinhalte
Möglicherweise ist ein manuelles Löschen des Cache erforderlich
Bei der Erstkonfiguration ist auf die Cache-Größenbegrenzungen zu achten
Eingeschränkte Anpassungsmöglichkeiten für Cache-Eviktionsrichtlinien
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
🧠 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: