Skip to content

Commit

Permalink
handle multiple click next button
Browse files Browse the repository at this point in the history
  • Loading branch information
anandnet committed Feb 4, 2024
1 parent 4ce8688 commit 6f88fda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/services/audio_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,15 @@ class MyAudioHandler extends BaseAudioHandler with GetxServiceMixin {
if (_playList.children.isNotEmpty) {
await _playList.clear();
}
currentIndex = extras!['index'];
final songIndex = extras!['index'];
currentIndex = songIndex;
final isNewUrlReq = extras['newUrl'] ?? false;
final currentSong = queue.value[currentIndex];
final url =
await checkNGetUrl(currentSong.id, generateNewUrl: isNewUrlReq);
mediaItem.add(currentSong);
currentSongUrl = url;
if (url == null) {
if (url == null || songIndex != currentIndex) {
return;
}
currentSong.extras!['url'] = url;
Expand Down

0 comments on commit 6f88fda

Please sign in to comment.