Skip to content

Commit

Permalink
fix: set false to playing if error occurs after a play request
Browse files Browse the repository at this point in the history
  • Loading branch information
addie9000 committed Oct 14, 2021
1 parent 94160da commit f3f0c5e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions just_audio/lib/just_audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -855,12 +855,17 @@ class AudioPlayer {
// NOTE: If a load() request happens simultaneously, this may result
// in two play requests being sent. The platform implementation should
// ignore the second play request since it is already playing.
_sendPlayRequest(await _platform, playCompleter);
_sendPlayRequest(await _platform, playCompleter)
.catchError((dynamic e) {
_playingSubject.add(false);
});
} else {
// If the native platform wasn't already active, activating it will
// implicitly restore the playing state and send a play request.
_setPlatformActive(true, playCompleter: playCompleter)
?.catchError((dynamic e) {});
?.catchError((dynamic e) {
_playingSubject.add(false);
});
}
}
} else {
Expand Down

0 comments on commit f3f0c5e

Please sign in to comment.