audio sschedule shutdown

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-08 15:19:23 +08:00
parent 8234b7ac92
commit 0c65605ac0
23 changed files with 466 additions and 593 deletions

View File

@@ -36,9 +36,9 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
static final List<MediaItem> _item = [];
bool enableBackgroundPlay = Pref.enableBackgroundPlay;
Future<void> Function()? onPlay;
Future<void> Function()? onPause;
Future<void> Function(Duration position)? onSeek;
Future<void>? Function()? onPlay;
Future<void>? Function()? onPause;
Future<void>? Function(Duration position)? onSeek;
@override
Future<void> play() {
@@ -89,8 +89,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
}
final AudioProcessingState processingState;
final playing = status == PlayerStatus.playing;
if (status == PlayerStatus.completed) {
if (status.isCompleted) {
processingState = AudioProcessingState.completed;
} else if (isBuffering) {
processingState = AudioProcessingState.buffering;
@@ -98,6 +97,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
processingState = AudioProcessingState.ready;
}
final playing = status.isPlaying;
playbackState.add(
playbackState.value.copyWith(
processingState: isBuffering