cached_video_player_plus icon indicating copy to clipboard operation
cached_video_player_plus copied to clipboard

Allow replacing the default implementations of the cache manager and storage

Open AlexV525 opened this issue 4 months ago • 6 comments

The storage interface has been extracted from the default implementation. Users can implement their own instead of using Get Storage or Shared Preferences.

AlexV525 avatar Sep 01 '25 08:09 AlexV525

I've made a couple of changes additionally:

  1. The storage interface was extracted with a more general interface that can be used to store any type of data.
  2. I've renamed VideoPlayerStorage to VideoPlayerMetadataStorage and made a type alias to deprecate VideoPlayerStorage, but I think we can safely remove it since the class was not exported directly before.

AlexV525 avatar Sep 01 '25 13:09 AlexV525

@OutdatedGuy friendly ping

AlexV525 avatar Sep 22 '25 01:09 AlexV525

https://github.com/user-attachments/assets/f181e8b6-48e8-41e7-8616-08b917393511

@AlexV525 the example app doesn't seems to be working correctly

OutdatedGuy avatar Oct 04 '25 07:10 OutdatedGuy

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

AlexV525 avatar Oct 10 '25 18:10 AlexV525

Hi @AlexV525, do you plan on fixing the example app? :)

OutdatedGuy avatar Oct 22 '25 19:10 OutdatedGuy

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.

AlexV525 avatar Oct 23 '25 04:10 AlexV525

Thanks for the contribution @AlexV525

OutdatedGuy avatar Dec 05 '25 09:12 OutdatedGuy