Skip to content

Commit

Permalink
fix: repeat single should not disable traversing with next/prev butto…
Browse files Browse the repository at this point in the history
…ns (#1061)

Fixes #1060
  • Loading branch information
Feichtmeier authored Nov 28, 2024
1 parent 25883c7 commit 4abc7b9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/player/player_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ class PlayerService {

_isCompletedSub ??= _player.stream.completed.listen((value) async {
if (value) {
await playNext();
if (_repeatSingle) {
_play(newAudio: _audio);
} else {
await playNext();
}
}
});

Expand Down Expand Up @@ -153,6 +157,7 @@ class PlayerService {
if (value == _audio) return;
if (value.audioType != _audio?.audioType) {
_shuffle = false;
_repeatSingle = false;
setRate(1);
}
_audio = value;
Expand Down Expand Up @@ -319,7 +324,7 @@ class PlayerService {

Future<void> playNext() async {
await safeLastPosition();
if (!repeatSingle && nextAudio != null) {
if (nextAudio != null) {
_setAudio(nextAudio!);
_estimateNext();
}
Expand Down

0 comments on commit 4abc7b9

Please sign in to comment.