mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 03:56:45 +08:00
opt in-app fullscreen
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1463,7 +1463,10 @@ class PlPlayerController {
|
||||
|
||||
// 全屏
|
||||
bool fsProcessing = false;
|
||||
Future<void> triggerFullScreen({bool status = true}) async {
|
||||
Future<void> triggerFullScreen({
|
||||
bool status = true,
|
||||
bool inAppFullScreen = false,
|
||||
}) async {
|
||||
if (fsProcessing) {
|
||||
return;
|
||||
}
|
||||
@@ -1493,10 +1496,10 @@ class PlPlayerController {
|
||||
(isVertical || size.height / size.width < 1.25)))) {
|
||||
await verticalScreenForTwoSeconds();
|
||||
} else {
|
||||
await landScape();
|
||||
await landscape(inAppFullScreen: inAppFullScreen);
|
||||
}
|
||||
} else if (isFullScreen.value && !status) {
|
||||
showStatusBar();
|
||||
showStatusBar(inAppFullScreen: inAppFullScreen);
|
||||
toggleFullScreen(false);
|
||||
if (mode == FullScreenMode.none) {
|
||||
fsProcessing = false;
|
||||
|
||||
@@ -8,14 +8,14 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
//横屏
|
||||
Future<void> landScape() async {
|
||||
Future<void> landscape({bool inAppFullScreen = false}) async {
|
||||
dynamic document;
|
||||
try {
|
||||
if (kIsWeb) {
|
||||
await document.documentElement?.requestFullscreen();
|
||||
} else if (Utils.isMobile) {
|
||||
await AutoOrientation.landscapeAutoMode(forceSensor: true);
|
||||
} else if (Utils.isDesktop && Pref.nativeFullscreen) {
|
||||
} else if (Utils.isDesktop && !inAppFullScreen) {
|
||||
await const MethodChannel(
|
||||
'com.alexmercerind/media_kit_video',
|
||||
).invokeMethod(
|
||||
@@ -76,7 +76,7 @@ Future<void> hideStatusBar() async {
|
||||
bool _showStatusBar = true;
|
||||
|
||||
//退出全屏显示
|
||||
Future<void> showStatusBar() async {
|
||||
Future<void> showStatusBar({bool inAppFullScreen = false}) async {
|
||||
if (_showStatusBar) {
|
||||
return;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ Future<void> showStatusBar() async {
|
||||
mode,
|
||||
overlays: SystemUiOverlay.values,
|
||||
);
|
||||
} else if (Utils.isDesktop && Pref.nativeFullscreen) {
|
||||
} else if (Utils.isDesktop && !inAppFullScreen) {
|
||||
await const MethodChannel(
|
||||
'com.alexmercerind/media_kit_video',
|
||||
).invokeMethod(
|
||||
|
||||
Reference in New Issue
Block a user