Skip to content

Commit

Permalink
fix b/1121
Browse files Browse the repository at this point in the history
  • Loading branch information
idy committed Nov 13, 2023
1 parent 4775390 commit 34ee289
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions just_audio_web/lib/just_audio_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -961,10 +961,15 @@ class _PlayPauseQueue {

Future<void> _run() async {
await for (var request in _queue.stream) {
if (request.playing) {
await audioElement.play();
} else {
audioElement.pause();
try {
if (request.playing) {
await audioElement.play();
} else {
audioElement.pause();
}
} catch (err) {
request.completer.completeError(err);
continue;
}
request.completer.complete();
}
Expand Down

0 comments on commit 34ee289

Please sign in to comment.