mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 退出全屏逻辑优化
This commit is contained in:
@@ -948,15 +948,15 @@ class PlPlayerController {
|
||||
|
||||
// 全屏
|
||||
Future<void> triggerFullScreen({bool status = true}) async {
|
||||
FullScreenMode mode = FullScreenModeCode.fromCode(
|
||||
setting.get(SettingBoxKey.fullScreenMode, defaultValue: 0))!;
|
||||
await StatusBarControl.setHidden(true, animation: StatusBarAnimation.FADE);
|
||||
if (!isFullScreen.value && status) {
|
||||
await StatusBarControl.setHidden(true, animation: StatusBarAnimation.FADE);
|
||||
/// 按照视频宽高比决定全屏方向
|
||||
toggleFullScreen(true);
|
||||
|
||||
/// 进入全屏
|
||||
await enterFullScreen();
|
||||
FullScreenMode mode = FullScreenModeCode.fromCode(
|
||||
setting.get(SettingBoxKey.fullScreenMode, defaultValue: 0))!;
|
||||
if (mode == FullScreenMode.vertical ||
|
||||
(mode == FullScreenMode.auto && direction.value == 'vertical') ||
|
||||
(mode == FullScreenMode.ratio &&
|
||||
@@ -999,12 +999,12 @@ class PlPlayerController {
|
||||
// toggleFullScreen(false);
|
||||
// }
|
||||
} else if (isFullScreen.value) {
|
||||
StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
|
||||
// Get.back();
|
||||
exitFullScreen();
|
||||
if (!setting.get(SettingBoxKey.horizontalScreen, defaultValue: false)) {
|
||||
await verticalScreen();
|
||||
StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
|
||||
// Get.back();
|
||||
// await verticalScreen();
|
||||
}
|
||||
exitFullScreen();
|
||||
toggleFullScreen(false);
|
||||
}
|
||||
if (triggerFullscreenCallback != null) {
|
||||
|
||||
@@ -5,6 +5,9 @@ import 'package:auto_orientation/auto_orientation.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../../../common/widgets/custom_toast.dart';
|
||||
import '../../../utils/storage.dart';
|
||||
|
||||
//横屏
|
||||
Future<void> landScape() async {
|
||||
dynamic document;
|
||||
@@ -74,7 +77,11 @@ Future<void> exitFullScreen() async {
|
||||
mode,
|
||||
overlays: SystemUiOverlay.values,
|
||||
);
|
||||
await SystemChrome.setPreferredOrientations([]);
|
||||
if (setting.get(SettingBoxKey.horizontalScreen, defaultValue: false)) {
|
||||
autoScreen();
|
||||
} else {
|
||||
verticalScreen();
|
||||
}
|
||||
} else if (Platform.isMacOS || Platform.isWindows || Platform.isLinux) {
|
||||
await const MethodChannel('com.alexmercerind/media_kit_video')
|
||||
.invokeMethod(
|
||||
|
||||
Reference in New Issue
Block a user