mod: 默认开启后台播放

This commit is contained in:
orz12
2024-04-06 09:31:45 +08:00
parent 3776cfee35
commit b45f8da189
4 changed files with 6 additions and 6 deletions

View File

@@ -135,7 +135,7 @@ class _PlaySettingState extends State<PlaySetting> {
title: '后台播放',
subTitle: '进入后台时继续播放',
setKey: SettingBoxKey.enableBackgroundPlay,
defaultVal: false,
defaultVal: true,
),
if (Platform.isAndroid)
SetSwitchItem(
@@ -146,7 +146,7 @@ class _PlaySettingState extends State<PlaySetting> {
callFn: (val) {
if (val &&
!setting.get(SettingBoxKey.enableBackgroundPlay,
defaultValue: false)) {
defaultValue: true)) {
SmartDialog.showToast('建议开启后台播放');
}
}),

View File

@@ -1291,7 +1291,7 @@ class _HeaderControlState extends State<HeaderControl> {
if (canUsePiP) {
bool enableBackgroundPlay = setting.get(
SettingBoxKey.enableBackgroundPlay,
defaultValue: false);
defaultValue: true);
if (!enableBackgroundPlay) {
// SmartDialog.showToast('建议开启【后台播放】功能\n避免画中画没有暂停按钮');
// await Future.delayed(const Duration(seconds: 2), () {

View File

@@ -312,7 +312,7 @@ class PlPlayerController {
.get(SettingBoxKey.enableAutoLongPressSpeed, defaultValue: false);
// 后台播放
_backgroundPlay.value =
setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: false);
setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: true);
if (!enableAutoLongPressSpeed) {
_longPressSpeed.value = videoStorage
.get(VideoBoxKey.longPressSpeedDefault, defaultValue: 3.0);

View File

@@ -25,7 +25,7 @@ Future<VideoPlayerServiceHandler> initAudioService() async {
class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
static final List<MediaItem> _item = [];
Box setting = GStrorage.setting;
bool enableBackgroundPlay = false;
bool enableBackgroundPlay = true;
PlPlayerController player = PlPlayerController.getInstance();
VideoPlayerServiceHandler() {
@@ -34,7 +34,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
revalidateSetting() {
enableBackgroundPlay =
setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: false);
setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: true);
}
@override