Skip to content

Commit

Permalink
clear before add and still use idle
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Jul 26, 2024
1 parent 98e3239 commit df84e4a
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions lib/services/audio_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,24 +181,22 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
return;
}

SmartDialog.showToast(
"${mediaItem.title}\n"
"${mediaItem.id}\n"
"${mediaItem.duration}\n"
"${mediaItem.artist}\n"
"${mediaItem.album}\n"
"${mediaItem.artUri}");
SmartDialog.showToast("${mediaItem.title}\n"
"${mediaItem.id}\n"
"${mediaItem.duration}\n"
"${mediaItem.artist}\n"
"${mediaItem.album}\n"
"${mediaItem.artUri}");
// _item.add(mediaItem);
clear();
setMediaItem(mediaItem);
}

onVideoDetailDispose() {
if (!enableBackgroundPlay) return;

playbackState.add(playbackState.value.copyWith(
processingState: Platform.isIOS
? AudioProcessingState.ready
: AudioProcessingState.idle,
processingState: AudioProcessingState.idle,
playing: false,
));
// if (_item.isNotEmpty) {
Expand All @@ -216,9 +214,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
if (!enableBackgroundPlay) return;
mediaItem.add(null);
playbackState.add(PlaybackState(
processingState: Platform.isIOS
? AudioProcessingState.ready
: AudioProcessingState.idle,
processingState: AudioProcessingState.idle,
playing: false,
));
// _item.clear();
Expand Down

0 comments on commit df84e4a

Please sign in to comment.