Added custom cacheManager and cache key
Summary
This PR addresses issue #47 by introducing the ability to pass a custom cacheManager and cacheKey as parameters. This makes the library more flexible and customizable, similar to how CachedNetworkImage handles caching.
Key Changes
-
Added support for passing
cacheManagerandcacheKeyparameters. -
This allows developers to:
- Use custom cache managers tailored to their specific needs.
- Preload videos from different sources using the same
cacheManagerandcacheKeyfor efficient caching.
-
Removed the
_storagevariable, as it was redundant. ThecacheManageralready tracks cache expiry dates and manages cached items, making additional storage management unnecessary.
Advantages
- Preload videos from anywhere
- Greater flexibility in cache management.
- Streamlined and simplified code by removing redundant storage handling.
- Easier integration with preloaded media files.
Thank you for reviewing!
@rignaneseleo thanks for the contribution. I'll review it once I get some free time.
Hello @rignaneseleo Ive a little concern on this idea I mean this is the whole concept of this package to cache the video
but if we allow developers to add their own custom cache feature dont you think we are bypassing the package implementation?
@rignaneseleo Would it be better to pass just the cache key as an argument? Changing the whole instance of the cache seems too much for me. I'm reproducing your PR locally on my project by the way.
Closing as stale