reduce rebuild

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-03-17 14:38:10 +08:00
parent 8a8aa6c1e0
commit d6579b29ae
23 changed files with 254 additions and 214 deletions

View File

@@ -108,7 +108,7 @@ class VideoDetailController extends GetxController
// 请求返回的视频信息
late PlayUrlModel data;
final Rx<LoadingState> videoState = LoadingState.loading().obs;
final RxBool videoState = false.obs;
/// 播放器配置 画质 音质 解码格式
final Rxn<VideoQuality> currentVideoQa = Rxn<VideoQuality>();
@@ -269,8 +269,6 @@ class VideoDetailController extends GetxController
}
}
bool imageview = false;
final isLoginVideo = Accounts.get(AccountType.video).isLogin;
late final watchProgress = GStorage.watchProgress;
@@ -711,9 +709,7 @@ class VideoDetailController extends GetxController
pgcType: isUgc ? null : pgcType,
videoType: videoType,
onInit: () {
if (videoState.value is! Success) {
videoState.value = const Success(null);
}
videoState.value = true;
setSubtitle(vttSubtitlesIndex.value);
},
width: firstVideo.width,
@@ -845,7 +841,7 @@ class VideoDetailController extends GetxController
if (data.dash == null) {
SmartDialog.showToast('视频资源不存在');
_autoPlay.value = false;
videoState.value = const Error('视频资源不存在');
videoState.value = false;
if (plPlayerController.isFullScreen.value) {
plPlayerController.toggleFullScreen(false);
}
@@ -940,7 +936,7 @@ class VideoDetailController extends GetxController
await _initPlayerIfNeeded(autoFullScreenFlag);
} else {
_autoPlay.value = false;
videoState.value = result..toast();
videoState.value = false;
if (plPlayerController.isFullScreen.value) {
plPlayerController.toggleFullScreen(false);
}