mod: 新增画中画不加载弹幕设置

This commit is contained in:
orz12
2024-03-15 21:10:40 +08:00
parent 8744f89bac
commit 9e57805ab6
3 changed files with 33 additions and 8 deletions

View File

@@ -143,6 +143,13 @@ class _PlaySettingState extends State<PlaySetting> {
setKey: SettingBoxKey.autoPiP,
defaultVal: false,
),
if (Platform.isAndroid)
const SetSwitchItem(
title: '画中画不加载弹幕',
subTitle: '当弹幕开关开启时,小窗屏蔽弹幕以获得较好的体验',
setKey: SettingBoxKey.pipNoDanmaku,
defaultVal: true,
),
const SetSwitchItem(
title: '全屏手势反向',
subTitle: '默认播放器中部向上滑动进入全屏,向下退出\n开启后向下全屏,向上退出',

View File

@@ -58,6 +58,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
late bool horizontalScreen;
late bool enableVerticalExpand;
late bool autoPiP;
late bool pipNoDanmaku;
final Floating floating = Floating();
// 生命周期监听
// late final AppLifecycleListener _lifecycleListener;
@@ -95,6 +96,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
autoPlayEnable =
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
autoPiP = setting.get(SettingBoxKey.autoPiP, defaultValue: false);
pipNoDanmaku = setting.get(SettingBoxKey.pipNoDanmaku, defaultValue: true);
enableVerticalExpand =
setting.get(SettingBoxKey.enableVerticalExpand, defaultValue: false);
videoSourceInit();
@@ -226,12 +228,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
setState(() {});
}
// if (!status) {
// showStatusBar();
// if (horizontalScreen) {
// autoScreen();
// } else {
// verticalScreenForTwoSeconds();
// }
// showStatusBar();
// if (horizontalScreen) {
// autoScreen();
// } else {
// verticalScreenForTwoSeconds();
// }
// }
});
}
@@ -384,12 +386,17 @@ class _VideoDetailPageState extends State<VideoDetailPage>
}
if (MediaQuery.of(context).orientation ==
Orientation.landscape &&
!horizontalScreen && !isFullScreen.value && isShowing && mounted) {
!horizontalScreen &&
!isFullScreen.value &&
isShowing &&
mounted) {
hideStatusBar();
}
if (MediaQuery.of(context).orientation ==
Orientation.portrait &&
!isFullScreen.value && isShowing && mounted) {
!isFullScreen.value &&
isShowing &&
mounted) {
showStatusBar();
}
return SizedBox(
@@ -863,6 +870,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
controller: plPlayerController,
videoDetailCtr: videoDetailController,
),
danmuWidget: pipNoDanmaku
? null
: Obx(
() => PlDanmaku(
key: Key(
videoDetailController.danmakuCid.value.toString()),
cid: videoDetailController.danmakuCid.value,
playerController: plPlayerController!,
),
),
),
);
if (!horizontalScreen) {

View File

@@ -98,6 +98,7 @@ class SettingBoxKey {
p1080 = 'p1080',
enableCDN = 'enableCDN',
autoPiP = 'autoPiP',
pipNoDanmaku = 'pipNoDanmaku',
enableAutoLongPressSpeed = 'enableAutoLongPressSpeed',
subtitlePreference = 'subtitlePreference',