diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 203f147a..766f051d 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -822,6 +822,15 @@ class _VideoDetailPageState extends State } }, ); + if (!horizontalScreen) { + if (Platform.isAndroid) { + return PiPSwitcher( + childWhenEnabled: childWhenEnabled, + childWhenDisabled: childWhenDisabled, + floating: floating,); + } + return childWhenDisabled; + } return OrientationBuilder( builder: (BuildContext context, Orientation orientation) { if (orientation == Orientation.landscape) { @@ -829,22 +838,16 @@ class _VideoDetailPageState extends State } if (Platform.isAndroid) { return PiPSwitcher( - childWhenDisabled: Container( - key: UniqueKey(), - child: !horizontalScreen || orientation == Orientation.portrait + childWhenDisabled: orientation == Orientation.portrait ? childWhenDisabled : childWhenDisabledLandscape, - ), childWhenEnabled: childWhenEnabled, floating: floating, ); } - return Container( - key: UniqueKey(), - child: !horizontalScreen || orientation == Orientation.portrait + return orientation == Orientation.portrait ? childWhenDisabled - : childWhenDisabledLandscape, - ); + : childWhenDisabledLandscape; }); } }