Skip to content

Commit

Permalink
changelog:
Browse files Browse the repository at this point in the history
fixed shuffle & repeat features
  • Loading branch information
gokadzev committed Jun 20, 2022
1 parent 48cbb0d commit 341595d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/services/audio_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,19 @@ Future<void> playSong(song) async {

Future changeShuffleStatus() async {
if (shuffleNotifier.value == true) {
MyAudioHandler().setShuffleMode(AudioServiceShuffleMode.none);
await audioPlayer?.setShuffleModeEnabled(false);
} else {
MyAudioHandler().setShuffleMode(AudioServiceShuffleMode.all);
await audioPlayer?.setShuffleModeEnabled(true);
}
}

Future changeLoopStatus() async {
if (repeatNotifier.value == false) {
repeatNotifier.value = true;
MyAudioHandler().setRepeatMode(AudioServiceRepeatMode.one);
await audioPlayer?.setLoopMode(LoopMode.one);
} else {
repeatNotifier.value = false;
MyAudioHandler().setRepeatMode(AudioServiceRepeatMode.none);
await audioPlayer?.setLoopMode(LoopMode.off);
}
}

Expand Down

0 comments on commit 341595d

Please sign in to comment.