Allow replacing the default implementations of the cache manager and storage
The storage interface has been extracted from the default implementation. Users can implement their own instead of using Get Storage or Shared Preferences.
I've made a couple of changes additionally:
- The storage interface was extracted with a more general interface that can be used to store any type of data.
- I've renamed
VideoPlayerStoragetoVideoPlayerMetadataStorageand made a type alias to deprecateVideoPlayerStorage, but I think we can safely remove it since the class was not exported directly before.
@OutdatedGuy friendly ping
https://github.com/user-attachments/assets/f181e8b6-48e8-41e7-8616-08b917393511
@AlexV525 the example app doesn't seems to be working correctly
Screen.Recording.2025-10-04.at.12.39.48.PM.mov @AlexV525 the example app doesn't seems to be working correctly
I'll look into it next week
Hi @AlexV525, do you plan on fixing the example app? :)
The example fails because the file caches always read from the SharedPreferences as the previous code implemented:
https://github.com/OutdatedGuy/cached_video_player_plus/blob/f5a32f8716aa3e9ea3bdbc5353f630e37f6e1cc5/example/lib/pages/advance_cache_management_page.dart#L83
This is a hard-coded behavior that implicitly uses the same storage as the default metadata storage.
I'll update the storage to provide an interface method like FutureOr<List<String>> get keys to get rid of this.
Thanks for the contribution @AlexV525