mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: 新增设置:横屏时返回可以直接返回为横屏页面,无需经过竖屏
This commit is contained in:
@@ -116,6 +116,12 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
setKey: SettingBoxKey.enableAutoExit,
|
setKey: SettingBoxKey.enableAutoExit,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
|
const SetSwitchItem(
|
||||||
|
title: '恢复竖屏',
|
||||||
|
subTitle: '退出全屏视频时自动恢复竖屏,关闭可以保持横屏状态',
|
||||||
|
setKey: SettingBoxKey.exitFullscreenAutoVertical,
|
||||||
|
defaultVal: true,
|
||||||
|
),
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: '开启硬解',
|
title: '开启硬解',
|
||||||
subTitle: '以较低功耗播放视频',
|
subTitle: '以较低功耗播放视频',
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
// 自动退出全屏
|
// 自动退出全屏
|
||||||
late bool autoExitFullcreen;
|
late bool autoExitFullcreen;
|
||||||
late bool autoPlayEnable;
|
late bool autoPlayEnable;
|
||||||
|
late bool exitFullscreenAutoVertical;
|
||||||
late bool autoPiP;
|
late bool autoPiP;
|
||||||
final Floating floating = Floating();
|
final Floating floating = Floating();
|
||||||
// 生命周期监听
|
// 生命周期监听
|
||||||
@@ -85,6 +86,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
statusBarHeight = localCache.get('statusBarHeight');
|
statusBarHeight = localCache.get('statusBarHeight');
|
||||||
autoExitFullcreen =
|
autoExitFullcreen =
|
||||||
setting.get(SettingBoxKey.enableAutoExit, defaultValue: false);
|
setting.get(SettingBoxKey.enableAutoExit, defaultValue: false);
|
||||||
|
exitFullscreenAutoVertical = setting
|
||||||
|
.get(SettingBoxKey.exitFullscreenAutoVertical, defaultValue: true);
|
||||||
autoPlayEnable =
|
autoPlayEnable =
|
||||||
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
|
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
|
||||||
autoPiP = setting.get(SettingBoxKey.autoPiP, defaultValue: false);
|
autoPiP = setting.get(SettingBoxKey.autoPiP, defaultValue: false);
|
||||||
@@ -345,7 +348,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
.triggerFullScreen(status: false);
|
.triggerFullScreen(status: false);
|
||||||
}
|
}
|
||||||
if (MediaQuery.of(context).orientation ==
|
if (MediaQuery.of(context).orientation ==
|
||||||
Orientation.landscape) {
|
Orientation.landscape &&
|
||||||
|
exitFullscreenAutoVertical) {
|
||||||
verticalScreen();
|
verticalScreen();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1069,7 +1069,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
else
|
else
|
||||||
<void>{
|
<void>{
|
||||||
if (MediaQuery.of(context).orientation ==
|
if (MediaQuery.of(context).orientation ==
|
||||||
Orientation.landscape)
|
Orientation.landscape &&
|
||||||
|
setting.get(SettingBoxKey.exitFullscreenAutoVertical,
|
||||||
|
defaultValue: true))
|
||||||
{
|
{
|
||||||
SystemChrome.setPreferredOrientations([
|
SystemChrome.setPreferredOrientations([
|
||||||
DeviceOrientation.portraitUp,
|
DeviceOrientation.portraitUp,
|
||||||
|
|||||||
@@ -995,7 +995,9 @@ class PlPlayerController {
|
|||||||
StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
|
StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
|
||||||
// Get.back();
|
// Get.back();
|
||||||
exitFullScreen();
|
exitFullScreen();
|
||||||
await verticalScreen();
|
if (setting.get(SettingBoxKey.exitFullscreenAutoVertical, defaultValue: true)) {
|
||||||
|
await verticalScreen();
|
||||||
|
}
|
||||||
toggleFullScreen(false);
|
toggleFullScreen(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ class SettingBoxKey {
|
|||||||
enableAutoBrightness = 'enableAutoBrightness',
|
enableAutoBrightness = 'enableAutoBrightness',
|
||||||
enableAutoEnter = 'enableAutoEnter',
|
enableAutoEnter = 'enableAutoEnter',
|
||||||
enableAutoExit = 'enableAutoExit',
|
enableAutoExit = 'enableAutoExit',
|
||||||
|
exitFullscreenAutoVertical = 'exitFullscreenAutoVertical',
|
||||||
p1080 = 'p1080',
|
p1080 = 'p1080',
|
||||||
enableCDN = 'enableCDN',
|
enableCDN = 'enableCDN',
|
||||||
autoPiP = 'autoPiP',
|
autoPiP = 'autoPiP',
|
||||||
|
|||||||
Reference in New Issue
Block a user