-
-
Notifications
You must be signed in to change notification settings - Fork 41
feat: allow replacing the default implementations of the cache manager and storage #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
aebfb22
♻️ Extract `IVideoPlayerStorage`
AlexV525 ce4c028
🚸 Allow changing the default cache manager and storage
AlexV525 6d00b83
🐛 Export entries
AlexV525 2e87718
🔥 Remove the constructor
AlexV525 e5e2d35
⚡️ Address review comments from @OutdatedGuy
AlexV525 a379413
♻️ Extract `IVideoPlayerStorage` and `IVideoPlayerMetadataStorage`
AlexV525 5cd67d9
🔥 Provide type alias deprecations
AlexV525 0c77ca7
🐛 Fix exports
AlexV525 62f683b
🔥 Flatten `IVideoPlayerStorage`
AlexV525 70eec5f
🚀 Add example
AlexV525 926385f
🚀 Add metadata storage example
AlexV525 1674b61
⚡️ Improve `MemoryVideoPlayerMetadataStorage`
AlexV525 ce50c4b
🐛 Fix incorrect comment's placement
AlexV525 a5c398f
🙈 Update ignored files
AlexV525 c9a7145
✨ `IVideoPlayerMetadataStorage.keys`
AlexV525 4d069fb
🐛 Fix storage referencing issues in the example
AlexV525 00df711
🐛 Fix Darwin compile
AlexV525 a226664
🚸 Improve example texts display
AlexV525 69c89e3
📝 Comments correction and improvement
AlexV525 8b6ad99
Revert "🐛 Fix Darwin compile"
AlexV525 330f516
Revert "🙈 Update ignored files"
AlexV525 93c1ea6
🔥 Remove references with the custom cache manager in the example
AlexV525 6e3d184
♻️ Move `MemoryVideoPlayerMetadataStorage`
AlexV525 b9aa124
💡 Update comment
AlexV525 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import 'package:cached_video_player_plus/cached_video_player_plus.dart' | ||
| show IVideoPlayerMetadataStorage; | ||
|
|
||
| /// Stores video metadata in memory. | ||
| class MemoryVideoPlayerMetadataStorage implements IVideoPlayerMetadataStorage { | ||
| final _data = <String, int>{}; | ||
|
|
||
| @override | ||
| Set<String> get keys => _data.keys.toSet(); | ||
|
|
||
| @override | ||
| Future<int?> read(String key) { | ||
| return Future.value(_data[key]); | ||
| } | ||
|
|
||
| @override | ||
| Future<void> write(String key, int value) { | ||
| return Future.sync(() => _data[key] = value); | ||
| } | ||
|
|
||
| @override | ||
| Future<void> remove(String key) { | ||
| return Future.sync(() => _data.remove(key)); | ||
| } | ||
|
|
||
| @override | ||
| Future<void> erase() { | ||
| return Future.sync(() => _data.clear()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.