feat: 拆分后台播放与AudioService在后台行为的设置

This commit is contained in:
orz12
2024-04-22 20:16:28 +08:00
parent 493d2a32c2
commit 9255f3cb69
5 changed files with 20 additions and 13 deletions

View File

@@ -140,20 +140,20 @@ class _PlaySettingState extends State<PlaySetting> {
const SetSwitchItem(
title: '后台播放',
subTitle: '进入后台时继续播放',
setKey: SettingBoxKey.enableBackgroundPlay,
setKey: SettingBoxKey.continuePlayInBackground,
defaultVal: true,
),
if (Platform.isAndroid)
SetSwitchItem(
title: '后台画中画',
subTitle: '进入后台时以小窗形式PiP播放,建议同时开启【后台播放】,避免没有暂停按钮',
subTitle: '进入后台时以小窗形式PiP播放',
setKey: SettingBoxKey.autoPiP,
defaultVal: false,
callFn: (val) {
if (val &&
!setting.get(SettingBoxKey.enableBackgroundPlay,
defaultValue: true)) {
SmartDialog.showToast('建议开启后台播放');
SmartDialog.showToast('建议开启后台音频服务');
}
}),
if (Platform.isAndroid)
@@ -227,6 +227,12 @@ class _PlaySettingState extends State<PlaySetting> {
}
},
),
const SetSwitchItem(
title: '后台音频服务',
subTitle: '避免画中画没有播放暂停功能',
setKey: SettingBoxKey.enableBackgroundPlay,
defaultVal: true,
),
],
),
);