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: '后台播放',
|
title: '后台播放',
|
||||||
subTitle: '进入后台时继续播放',
|
subTitle: '进入后台时继续播放',
|
||||||
setKey: SettingBoxKey.enableBackgroundPlay,
|
setKey: SettingBoxKey.enableBackgroundPlay,
|
||||||
defaultVal: false,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
if (Platform.isAndroid)
|
if (Platform.isAndroid)
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
@@ -146,7 +146,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
callFn: (val) {
|
callFn: (val) {
|
||||||
if (val &&
|
if (val &&
|
||||||
!setting.get(SettingBoxKey.enableBackgroundPlay,
|
!setting.get(SettingBoxKey.enableBackgroundPlay,
|
||||||
defaultValue: false)) {
|
defaultValue: true)) {
|
||||||
SmartDialog.showToast('建议开启后台播放');
|
SmartDialog.showToast('建议开启后台播放');
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1291,7 +1291,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
if (canUsePiP) {
|
if (canUsePiP) {
|
||||||
bool enableBackgroundPlay = setting.get(
|
bool enableBackgroundPlay = setting.get(
|
||||||
SettingBoxKey.enableBackgroundPlay,
|
SettingBoxKey.enableBackgroundPlay,
|
||||||
defaultValue: false);
|
defaultValue: true);
|
||||||
if (!enableBackgroundPlay) {
|
if (!enableBackgroundPlay) {
|
||||||
// SmartDialog.showToast('建议开启【后台播放】功能\n避免画中画没有暂停按钮');
|
// SmartDialog.showToast('建议开启【后台播放】功能\n避免画中画没有暂停按钮');
|
||||||
// await Future.delayed(const Duration(seconds: 2), () {
|
// await Future.delayed(const Duration(seconds: 2), () {
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ class PlPlayerController {
|
|||||||
.get(SettingBoxKey.enableAutoLongPressSpeed, defaultValue: false);
|
.get(SettingBoxKey.enableAutoLongPressSpeed, defaultValue: false);
|
||||||
// 后台播放
|
// 后台播放
|
||||||
_backgroundPlay.value =
|
_backgroundPlay.value =
|
||||||
setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: false);
|
setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: true);
|
||||||
if (!enableAutoLongPressSpeed) {
|
if (!enableAutoLongPressSpeed) {
|
||||||
_longPressSpeed.value = videoStorage
|
_longPressSpeed.value = videoStorage
|
||||||
.get(VideoBoxKey.longPressSpeedDefault, defaultValue: 3.0);
|
.get(VideoBoxKey.longPressSpeedDefault, defaultValue: 3.0);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Future<VideoPlayerServiceHandler> initAudioService() async {
|
|||||||
class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
||||||
static final List<MediaItem> _item = [];
|
static final List<MediaItem> _item = [];
|
||||||
Box setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
bool enableBackgroundPlay = false;
|
bool enableBackgroundPlay = true;
|
||||||
PlPlayerController player = PlPlayerController.getInstance();
|
PlPlayerController player = PlPlayerController.getInstance();
|
||||||
|
|
||||||
VideoPlayerServiceHandler() {
|
VideoPlayerServiceHandler() {
|
||||||
@@ -34,7 +34,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
|||||||
|
|
||||||
revalidateSetting() {
|
revalidateSetting() {
|
||||||
enableBackgroundPlay =
|
enableBackgroundPlay =
|
||||||
setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: false);
|
setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user