mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
tweaks
cache season fav state Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1721,7 +1721,9 @@ class PlPlayerController {
|
||||
disableAutoEnterPip();
|
||||
setPlayCallBack(null);
|
||||
dmState.clear();
|
||||
_clearPreview();
|
||||
if (showSeekPreview) {
|
||||
_clearPreview();
|
||||
}
|
||||
Utils.channel.setMethodCallHandler(null);
|
||||
_timer?.cancel();
|
||||
_timerForSeek?.cancel();
|
||||
@@ -1744,6 +1746,9 @@ class PlPlayerController {
|
||||
}
|
||||
|
||||
await removeListeners();
|
||||
subscriptions.clear();
|
||||
_positionListeners.clear();
|
||||
_statusListeners.clear();
|
||||
if (playerStatus.playing) {
|
||||
WakelockPlus.disable();
|
||||
}
|
||||
@@ -1779,7 +1784,7 @@ class PlPlayerController {
|
||||
);
|
||||
}
|
||||
|
||||
final Map<String, ui.Image?> previewCache = {};
|
||||
late final Map<String, ui.Image?> previewCache = {};
|
||||
LoadingState<VideoShotData>? videoShot;
|
||||
late final RxBool showPreview = false.obs;
|
||||
late final showSeekPreview = Pref.showSeekPreview;
|
||||
|
||||
@@ -1846,6 +1846,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
plPlayerController,
|
||||
maxWidth,
|
||||
maxHeight,
|
||||
() => mounted,
|
||||
),
|
||||
|
||||
if (isFullScreen || plPlayerController.isDesktopPip) ...[
|
||||
@@ -2537,6 +2538,7 @@ Widget buildSeekPreviewWidget(
|
||||
PlPlayerController plPlayerController,
|
||||
double maxWidth,
|
||||
double maxHeight,
|
||||
ValueGetter<bool> isMounted,
|
||||
) {
|
||||
return Obx(
|
||||
() {
|
||||
@@ -2591,6 +2593,7 @@ Widget buildSeekPreviewWidget(
|
||||
onSetSize: (xSize, ySize) => data
|
||||
..imgXSize = imgXSize = xSize
|
||||
..imgYSize = imgYSize = ySize,
|
||||
isMounted: isMounted,
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -2615,6 +2618,7 @@ class VideoShotImage extends StatefulWidget {
|
||||
required this.imgYSize,
|
||||
required this.height,
|
||||
required this.onSetSize,
|
||||
required this.isMounted,
|
||||
});
|
||||
|
||||
final Map<String, ui.Image?> imageCache;
|
||||
@@ -2625,6 +2629,7 @@ class VideoShotImage extends StatefulWidget {
|
||||
final double imgYSize;
|
||||
final double height;
|
||||
final Function(double imgXSize, double imgYSize) onSetSize;
|
||||
final ValueGetter<bool> isMounted;
|
||||
|
||||
@override
|
||||
State<VideoShotImage> createState() => _VideoShotImageState();
|
||||
@@ -2707,7 +2712,9 @@ class _VideoShotImageState extends State<VideoShotImage> {
|
||||
widget.imageCache[url] = null;
|
||||
_getImg(url).then((image) {
|
||||
if (image != null) {
|
||||
widget.imageCache[url] = image;
|
||||
if (widget.isMounted()) {
|
||||
widget.imageCache[url] = image;
|
||||
}
|
||||
if (mounted) {
|
||||
_image = image;
|
||||
_initSizeIfNeeded();
|
||||
|
||||
Reference in New Issue
Block a user