From ff4ea8c457fb2548e0fa71b221aae135b1f1bcf1 Mon Sep 17 00:00:00 2001 From: orz12 Date: Wed, 13 Mar 2024 21:21:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9D=9E=E6=A8=AA=E5=B1=8F=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E7=9F=AD=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/view.dart | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 32f92c9b..cd20ca96 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -382,6 +382,16 @@ class _VideoDetailPageState extends State videoDetailController.tabCtr.index != 1) { videoheight = context.width * 5 / 4; } + if (MediaQuery.of(context).orientation == + Orientation.landscape && + !horizontalScreen && !isFullScreen.value && isShowing && mounted) { + hideStatusBar(); + } + if (MediaQuery.of(context).orientation == + Orientation.portrait && + !isFullScreen.value && isShowing && mounted) { + showStatusBar(); + } return SizedBox( height: MediaQuery.of(context).orientation == Orientation.landscape || @@ -855,6 +865,18 @@ class _VideoDetailPageState extends State ), ), ); + if (!horizontalScreen) { + Orientation orientation = MediaQuery.of(context).orientation; + if (Platform.isAndroid) { + return PiPSwitcher( + childWhenDisabled: childWhenDisabled, + childWhenEnabled: childWhenEnabled, + floating: floating, + ); + } + return childWhenDisabled; + } + return OrientationBuilder( builder: (BuildContext context, Orientation orientation) { if (!isShowing) {