From d59c364ba6553163ce34960db582c0185e4f9f39 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 6 Jan 2025 12:08:21 +0800 Subject: [PATCH] fix: auto play Signed-off-by: bggRGjQaUbCoE --- lib/pages/media/controller.dart | 13 ++++++++----- lib/pages/video/detail/controller.dart | 9 +++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/pages/media/controller.dart b/lib/pages/media/controller.dart index af2e0137..4e70f8bd 100644 --- a/lib/pages/media/controller.dart +++ b/lib/pages/media/controller.dart @@ -59,9 +59,12 @@ class MediaController extends CommonController { } @override - Future customGetData() => UserHttp.userfavFolder( - pn: 1, - ps: 5, - mid: mid, - ); + Future customGetData() { + mid ??= GStorage.userInfo.get('userInfoCache')?.mid; + return UserHttp.userfavFolder( + pn: 1, + ps: 5, + mid: mid, + ); + } } diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index b39d04b7..ca99c30d 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -1120,6 +1120,7 @@ class VideoDetailController extends GetxController if (autoPlay.value && videoUrl != null && audioUrl != null) { isShowCover.value = false; await playerInit(); + videoState.value = LoadingState.success(null); } isQuerying = false; } @@ -1175,7 +1176,9 @@ class VideoDetailController extends GetxController // isShowCover.value = false; // await playerInit(); // } - videoState.value = LoadingState.success(null); + if (autoPlay.value.not) { + videoState.value = LoadingState.success(null); + } return; } @@ -1288,7 +1291,9 @@ class VideoDetailController extends GetxController // isShowCover.value = false; // await playerInit(); // } - videoState.value = LoadingState.success(null); + if (autoPlay.value.not) { + videoState.value = LoadingState.success(null); + } } else { autoPlay.value = false; isShowCover.value = true;