mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
opt: cache image (#1787)
This commit is contained in:
committed by
GitHub
parent
952d168022
commit
d80324655e
@@ -1779,7 +1779,7 @@ class PlPlayerController {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, WeakReference<ui.Image>>? previewCache;
|
||||
final Map<String, ui.Image?> previewCache = {};
|
||||
LoadingState<VideoShotData>? videoShot;
|
||||
late final RxBool showPreview = false.obs;
|
||||
late final showSeekPreview = Pref.showSeekPreview;
|
||||
@@ -1807,14 +1807,10 @@ class PlPlayerController {
|
||||
showPreview.value = false;
|
||||
previewIndex.value = null;
|
||||
videoShot = null;
|
||||
previewCache
|
||||
?..forEach((_, ref) {
|
||||
try {
|
||||
ref.target?.dispose();
|
||||
} catch (_) {}
|
||||
})
|
||||
..clear();
|
||||
previewCache = null;
|
||||
for (var i in previewCache.values) {
|
||||
i?.dispose();
|
||||
}
|
||||
previewCache.clear();
|
||||
}
|
||||
|
||||
Future<void> getVideoShot() async {
|
||||
|
||||
Reference in New Issue
Block a user