cached_video_player_plus icon indicating copy to clipboard operation
cached_video_player_plus copied to clipboard

Added custom cacheManager and cache key

Open rignaneseleo opened this issue 1 year ago • 3 comments

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 cacheManager and cacheKey parameters.

  • This allows developers to:

    • Use custom cache managers tailored to their specific needs.
    • Preload videos from different sources using the same cacheManager and cacheKey for efficient caching.
  • Removed the _storage variable, as it was redundant. The cacheManager already 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 avatar Sep 27 '24 13:09 rignaneseleo