Skip to content

Commit

Permalink
fix(playback): shuffle button sometimes gets stuck and stops working #…
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Aug 26, 2022
1 parent cdcc0d3 commit 4240433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/provider/Playback.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:audio_service/audio_service.dart';
import 'package:audioplayers/audioplayers.dart';
Expand Down Expand Up @@ -168,6 +167,7 @@ class Playback extends PersistedChangeNotifier {
Future<void> playPlaylist(CurrentPlaylist playlist, [int index = 0]) async {
try {
if (index < 0 || index > playlist.tracks.length - 1) return;
if (isPlaying || status == PlaybackStatus.playing) await stop();
this.playlist = playlist;
final played = this.playlist!.tracks[index];
status = PlaybackStatus.loading;
Expand Down

0 comments on commit 4240433

Please sign in to comment.