From 3c466d5748ed300f6b35e7f49638d0b5c3415a19 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 28 Jul 2025 16:36:31 +0800 Subject: [PATCH] tweak Signed-off-by: bggRGjQaUbCoE --- lib/pages/video/view.dart | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/pages/video/view.dart b/lib/pages/video/view.dart index 9b0315a33..a4235fa43 100644 --- a/lib/pages/video/view.dart +++ b/lib/pages/video/view.dart @@ -184,20 +184,17 @@ class _VideoDetailPageVState extends State videoDetailController.plPlayerController.showDanmaku = true; // 修复从后台恢复时全屏状态下屏幕方向错误的问题 - if (plPlayerController?.isFullScreen.value == true) { - // 延迟一点执行,确保应用完全恢复 - Future.delayed(const Duration(milliseconds: 100), () async { + if (isFullScreen && Platform.isIOS) { + WidgetsBinding.instance.addPostFrameCallback((_) { // 根据视频方向重新设置屏幕方向 - final isVertical = plPlayerController?.isVertical ?? false; + final isVertical = videoDetailController.isVertical.value; final mode = plPlayerController?.mode; - if (mode == FullScreenMode.vertical || + if (!(mode == FullScreenMode.vertical || (mode == FullScreenMode.auto && isVertical) || (mode == FullScreenMode.ratio && - (Get.height / Get.width < 1.25 || isVertical))) { - await verticalScreenForTwoSeconds(); - } else { - await landScape(); + (Get.height / Get.width < 1.25 || isVertical)))) { + landScape(); } }); }