Better handling of sequential platform activations/deactivations.
This commit is contained in:
parent
4cab031d30
commit
9ab7d8b210
4 changed files with 681 additions and 679 deletions
|
@ -15,12 +15,12 @@ class JustAudioPlugin extends JustAudioPlatform {
|
|||
}
|
||||
|
||||
Future<AudioPlayerPlatform> init(InitRequest request) async {
|
||||
final player = Html5AudioPlayer(id: request.id);
|
||||
if (players.containsKey(request.id)) {
|
||||
throw PlatformException(
|
||||
code: "error",
|
||||
message: "Platform player ${request.id} already exists");
|
||||
}
|
||||
final player = Html5AudioPlayer(id: request.id);
|
||||
players[request.id] = player;
|
||||
return player;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue