Skip to content

Commit

Permalink
fix: shuffle not working (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho authored Jul 8, 2023
1 parent 0089d47 commit dc76634
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/services/audio_player/mk_state_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class MkPlayerWithState extends Player {
_playlist = null;
_tempMedias = null;
_playerStateStream.add(AudioPlaybackState.stopped);
_shuffleStream.add(false);
}

@override
Expand Down Expand Up @@ -242,6 +243,12 @@ class MkPlayerWithState extends Player {
play: true,
);
}

// replace in the _tempMedias if it's not null
if (shuffled && _tempMedias != null) {
final tempIndex = _tempMedias!.indexOf(media);
_tempMedias![tempIndex] = Media(newUrl, extras: media.extras);
}
break;
}
}
Expand Down

0 comments on commit dc76634

Please sign in to comment.