mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 竖屏改为只持续两秒
This commit is contained in:
@@ -181,7 +181,7 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
|||||||
}
|
}
|
||||||
if (MediaQuery.of(context).orientation ==
|
if (MediaQuery.of(context).orientation ==
|
||||||
Orientation.landscape) {
|
Orientation.landscape) {
|
||||||
verticalScreen();
|
verticalScreenForTwoSeconds();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
|
|||||||
@@ -200,20 +200,20 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
plPlayerController!.isFullScreen.listen((bool status) {
|
plPlayerController!.isFullScreen.listen((bool status) {
|
||||||
if (status) {
|
if (status) {
|
||||||
videoDetailController.hiddenReplyReplyPanel();
|
videoDetailController.hiddenReplyReplyPanel();
|
||||||
hideStatusBar();
|
// hideStatusBar();
|
||||||
}
|
}
|
||||||
isFullScreen.value = status;
|
isFullScreen.value = status;
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
if (!status) {
|
// if (!status) {
|
||||||
showStatusBar();
|
// showStatusBar();
|
||||||
if (horizontalScreen) {
|
// if (horizontalScreen) {
|
||||||
autoScreen();
|
// autoScreen();
|
||||||
} else {
|
// } else {
|
||||||
verticalScreen();
|
// verticalScreenForTwoSeconds();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
if (MediaQuery.of(context).orientation ==
|
if (MediaQuery.of(context).orientation ==
|
||||||
Orientation.landscape &&
|
Orientation.landscape &&
|
||||||
!horizontalScreen) {
|
!horizontalScreen) {
|
||||||
verticalScreen();
|
verticalScreenForTwoSeconds();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@@ -623,7 +623,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
if (MediaQuery.of(context).orientation ==
|
if (MediaQuery.of(context).orientation ==
|
||||||
Orientation.landscape &&
|
Orientation.landscape &&
|
||||||
!horizontalScreen) {
|
!horizontalScreen) {
|
||||||
verticalScreen();
|
verticalScreenForTwoSeconds();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
|||||||
@@ -1052,7 +1052,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
Orientation.landscape &&
|
Orientation.landscape &&
|
||||||
!horizontalScreen)
|
!horizontalScreen)
|
||||||
{
|
{
|
||||||
verticalScreen(),
|
verticalScreenForTwoSeconds(),
|
||||||
},
|
},
|
||||||
Get.back()
|
Get.back()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -992,6 +992,8 @@ class PlPlayerController {
|
|||||||
|
|
||||||
// 全屏
|
// 全屏
|
||||||
Future<void> triggerFullScreen({bool status = true}) async {
|
Future<void> triggerFullScreen({bool status = true}) async {
|
||||||
|
FullScreenMode mode = FullScreenModeCode.fromCode(
|
||||||
|
setting.get(SettingBoxKey.fullScreenMode, defaultValue: 0))!;
|
||||||
if (!isFullScreen.value && status) {
|
if (!isFullScreen.value && status) {
|
||||||
// StatusBarControl.setHidden(true, animation: StatusBarAnimation.FADE);
|
// StatusBarControl.setHidden(true, animation: StatusBarAnimation.FADE);
|
||||||
hideStatusBar();
|
hideStatusBar();
|
||||||
@@ -1000,8 +1002,6 @@ class PlPlayerController {
|
|||||||
toggleFullScreen(true);
|
toggleFullScreen(true);
|
||||||
|
|
||||||
/// 进入全屏
|
/// 进入全屏
|
||||||
FullScreenMode mode = FullScreenModeCode.fromCode(
|
|
||||||
setting.get(SettingBoxKey.fullScreenMode, defaultValue: 0))!;
|
|
||||||
if (mode == FullScreenMode.none) {
|
if (mode == FullScreenMode.none) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1010,7 +1010,7 @@ class PlPlayerController {
|
|||||||
(mode == FullScreenMode.ratio &&
|
(mode == FullScreenMode.ratio &&
|
||||||
(Get.height / Get.width < 1.25 ||
|
(Get.height / Get.width < 1.25 ||
|
||||||
direction.value == 'vertical'))) {
|
direction.value == 'vertical'))) {
|
||||||
await verticalScreen();
|
await verticalScreenForTwoSeconds();
|
||||||
} else {
|
} else {
|
||||||
await landScape();
|
await landScape();
|
||||||
}
|
}
|
||||||
@@ -1018,8 +1018,9 @@ class PlPlayerController {
|
|||||||
// StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
|
// StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
|
||||||
showStatusBar();
|
showStatusBar();
|
||||||
toggleFullScreen(false);
|
toggleFullScreen(false);
|
||||||
if (!setting.get(SettingBoxKey.horizontalScreen, defaultValue: false)) {
|
if (!setting.get(SettingBoxKey.horizontalScreen, defaultValue: false) &&
|
||||||
await verticalScreen();
|
mode != FullScreenMode.none) {
|
||||||
|
await verticalScreenForTwoSeconds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,16 @@ Future<void> landScape() async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//竖屏
|
||||||
|
Future<void> verticalScreenForTwoSeconds() async {
|
||||||
|
await SystemChrome.setPreferredOrientations([
|
||||||
|
DeviceOrientation.portraitUp,
|
||||||
|
]);
|
||||||
|
Future.delayed(const Duration(seconds: 2), () {
|
||||||
|
autoScreen();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//竖屏
|
//竖屏
|
||||||
Future<void> verticalScreen() async {
|
Future<void> verticalScreen() async {
|
||||||
await SystemChrome.setPreferredOrientations([
|
await SystemChrome.setPreferredOrientations([
|
||||||
|
|||||||
Reference in New Issue
Block a user