mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-28 14:25:55 +08:00
mod: lint
mod: tweaks opt: publish page Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -33,7 +33,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
||||
revalidateSetting();
|
||||
}
|
||||
|
||||
revalidateSetting() {
|
||||
void revalidateSetting() {
|
||||
enableBackgroundPlay = GStorage.setting
|
||||
.get(SettingBoxKey.enableBackgroundPlay, defaultValue: true);
|
||||
}
|
||||
@@ -105,14 +105,14 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
||||
));
|
||||
}
|
||||
|
||||
onStatusChange(PlayerStatus status, bool isBuffering, isLive) {
|
||||
void onStatusChange(PlayerStatus status, bool isBuffering, isLive) {
|
||||
if (!enableBackgroundPlay) return;
|
||||
|
||||
if (_item.isEmpty) return;
|
||||
setPlaybackState(status, isBuffering, isLive);
|
||||
}
|
||||
|
||||
onVideoDetailChange(dynamic data, int cid, String herotag) {
|
||||
void onVideoDetailChange(dynamic data, int cid, String herotag) {
|
||||
if (!enableBackgroundPlay) return;
|
||||
// debugPrint('当前调用栈为:');
|
||||
// debugPrint(StackTrace.current);
|
||||
@@ -168,7 +168,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
||||
setMediaItem(mediaItem);
|
||||
}
|
||||
|
||||
onVideoDetailDispose(String herotag) {
|
||||
void onVideoDetailDispose(String herotag) {
|
||||
if (!enableBackgroundPlay) return;
|
||||
|
||||
if (_item.isNotEmpty) {
|
||||
@@ -184,7 +184,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
||||
}
|
||||
}
|
||||
|
||||
clear() {
|
||||
void clear() {
|
||||
if (!enableBackgroundPlay) return;
|
||||
mediaItem.add(null);
|
||||
_item.clear();
|
||||
@@ -206,7 +206,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
||||
));
|
||||
}
|
||||
|
||||
onPositionChange(Duration position) {
|
||||
void onPositionChange(Duration position) {
|
||||
if (!enableBackgroundPlay ||
|
||||
_item.isEmpty ||
|
||||
PlPlayerController.instanceExists().not) return;
|
||||
|
||||
@@ -6,7 +6,7 @@ class AudioSessionHandler {
|
||||
late AudioSession session;
|
||||
bool _playInterrupted = false;
|
||||
|
||||
setActive(bool active) {
|
||||
void setActive(bool active) {
|
||||
session.setActive(active);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// final _loggerFactory =
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -17,7 +15,7 @@ class PiliLogger extends Logger {
|
||||
PiliLogger() : super();
|
||||
|
||||
@override
|
||||
void log(Level level, dynamic message,
|
||||
Future<void> log(Level level, dynamic message,
|
||||
{Object? error, StackTrace? stackTrace, DateTime? time}) async {
|
||||
if (level == Level.error || level == Level.fatal) {
|
||||
// 添加至文件末尾
|
||||
@@ -35,7 +33,7 @@ Future<File> getLogsPath() async {
|
||||
String dir = (await getApplicationDocumentsDirectory()).path;
|
||||
final String filename = p.join(dir, ".pili_logs");
|
||||
final File file = File(filename);
|
||||
if (!await file.exists()) {
|
||||
if (!file.existsSync()) {
|
||||
await file.create(recursive: true);
|
||||
}
|
||||
return file;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'audio_handler.dart';
|
||||
import 'audio_session.dart';
|
||||
import 'package:PiliPlus/services/audio_handler.dart';
|
||||
import 'package:PiliPlus/services/audio_session.dart';
|
||||
|
||||
late VideoPlayerServiceHandler videoPlayerServiceHandler;
|
||||
late AudioSessionHandler audioSessionHandler;
|
||||
|
||||
Reference in New Issue
Block a user