mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
feat: inapp fullscreen (#1330)
This commit is contained in:
committed by
GitHub
parent
4ae3bd2845
commit
5fd3d32200
@@ -309,4 +309,13 @@ List<SettingsModel> get playSettings => [
|
|||||||
setKey: SettingBoxKey.tempPlayerConf,
|
setKey: SettingBoxKey.tempPlayerConf,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
|
if (Utils.isDesktop)
|
||||||
|
const SettingsModel(
|
||||||
|
settingsType: SettingsType.sw1tch,
|
||||||
|
title: '独占全屏',
|
||||||
|
subtitle: '关闭为应用内全屏',
|
||||||
|
leading: Icon(Icons.zoom_out_map_rounded),
|
||||||
|
setKey: SettingBoxKey.nativeFullscreen,
|
||||||
|
defaultVal: true,
|
||||||
|
),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Future<void> landScape() async {
|
|||||||
await document.documentElement?.requestFullscreen();
|
await document.documentElement?.requestFullscreen();
|
||||||
} else if (Utils.isMobile) {
|
} else if (Utils.isMobile) {
|
||||||
await AutoOrientation.landscapeAutoMode(forceSensor: true);
|
await AutoOrientation.landscapeAutoMode(forceSensor: true);
|
||||||
} else if (Utils.isDesktop) {
|
} else if (Utils.isDesktop && Pref.nativeFullscreen) {
|
||||||
await const MethodChannel(
|
await const MethodChannel(
|
||||||
'com.alexmercerind/media_kit_video',
|
'com.alexmercerind/media_kit_video',
|
||||||
).invokeMethod(
|
).invokeMethod(
|
||||||
@@ -94,17 +94,14 @@ Future<void> showStatusBar() async {
|
|||||||
mode,
|
mode,
|
||||||
overlays: SystemUiOverlay.values,
|
overlays: SystemUiOverlay.values,
|
||||||
);
|
);
|
||||||
} else if (Utils.isDesktop) {
|
} else if (Utils.isDesktop && Pref.nativeFullscreen) {
|
||||||
await const MethodChannel(
|
await const MethodChannel(
|
||||||
'com.alexmercerind/media_kit_video',
|
'com.alexmercerind/media_kit_video',
|
||||||
).invokeMethod(
|
).invokeMethod(
|
||||||
'Utils.ExitNativeFullscreen',
|
'Utils.ExitNativeFullscreen',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (exception, stacktrace) {
|
} catch (_) {
|
||||||
if (kDebugMode) {
|
if (kDebugMode) rethrow;
|
||||||
debugPrint(exception.toString());
|
|
||||||
debugPrint(stacktrace.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,8 @@ abstract class SettingBoxKey {
|
|||||||
enableGradientBg = 'enableGradientBg',
|
enableGradientBg = 'enableGradientBg',
|
||||||
navBarSort = 'navBarSort',
|
navBarSort = 'navBarSort',
|
||||||
tempPlayerConf = 'tempPlayerConf',
|
tempPlayerConf = 'tempPlayerConf',
|
||||||
reduceLuxColor = 'reduceLuxColor';
|
reduceLuxColor = 'reduceLuxColor',
|
||||||
|
nativeFullscreen = 'nativeFullscreen';
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class LocalCacheKey {
|
abstract class LocalCacheKey {
|
||||||
|
|||||||
@@ -832,4 +832,7 @@ abstract class Pref {
|
|||||||
|
|
||||||
static bool get keyboardControl =>
|
static bool get keyboardControl =>
|
||||||
_setting.get(SettingBoxKey.keyboardControl, defaultValue: true);
|
_setting.get(SettingBoxKey.keyboardControl, defaultValue: true);
|
||||||
|
|
||||||
|
static bool get nativeFullscreen =>
|
||||||
|
_setting.get(SettingBoxKey.nativeFullscreen, defaultValue: true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user