mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 默认开启后台播放
This commit is contained in:
@@ -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('建议开启后台播放');
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -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), () {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user