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

@rignaneseleo thanks for the contribution. I'll review it once I get some free time.

OutdatedGuy avatar Oct 23 '24 13:10 OutdatedGuy

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?

Musaddiq625 avatar Dec 05 '24 10:12 Musaddiq625

@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.

gmr-renato avatar Mar 16 '25 23:03 gmr-renato

Closing as stale

OutdatedGuy avatar Jul 08 '25 16:07 OutdatedGuy