Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only dispose of instance if all playerKeys are removed #317

Conversation

mattbajorek
Copy link
Contributor

Issue

Currently the dispose method will remove the platform instance if there is still one player currently activate.

Fix

Wait until all players are being disposed to remove the platform instance.

@@ -279,7 +279,7 @@ class PlayerController extends ChangeNotifier {
if (playerState != PlayerState.stopped) await stopPlayer();
await release();
PlatformStreams.instance.playerControllerFactory.remove(playerKey);
if (PlatformStreams.instance.playerControllerFactory.length == 1) {
if (PlatformStreams.instance.playerControllerFactory.isEmpty) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Quite an oversight.

@ujas-m-simformsolutions ujas-m-simformsolutions merged commit f5e4c61 into SimformSolutionsPvtLtd:main Jul 30, 2024
hemantbeast pushed a commit to hemantbeast/audio_waveforms that referenced this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants