Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

Commit

Permalink
fix play/pause - check before connecting
Browse files Browse the repository at this point in the history
  • Loading branch information
yringler committed Jun 12, 2020
1 parent 5b9088b commit 6a4f1dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/background/audio-states/playing-state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ class PlayingState extends MediaStateBase {

@override
Future<void> setUrl(String url) async {
// No need to connect if we already did.
// TODO: this check is in every change to ConnectingState. This should be less manual.
if (url == context.mediaItem.id) {
return;
}

context.stateHandler = ConnectingState(context: context);
await context.stateHandler.setUrl(url);
}
Expand Down

0 comments on commit 6a4f1dc

Please sign in to comment.