-
Notifications
You must be signed in to change notification settings - Fork 856
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
MediaPlayer gets cleaned up after every completion (Android) #11
Comments
It seems that this behavior was introduced on #7 by @the4thfloor as part of an awesome refactoring related to UI blocking; I wonder if there is a reason for that, or if it was just a slip. What do you guys think? If it is the case, simply removing this line 84 will be better? If so, I'd be glad to merge a PR. Thanks for your contributions and sorry for the delay! |
You have to remove line 83 too because after |
The way this is handled was fixed in 0.7.0. More details on readme, but basically the players are released by default when finished or stopped, unless you change the release mode. Released players are always recreated when requested (so the lifecycle of the android MediaPlayer is transparent to the user). |
In the callback of the completion event of the Android MediaPlayer the MediaPlayer instance is being removed from the mediaPlayers hashmap:
https://github.com/luanpotter/audioplayer/blob/f67a3a219c6dd3eed9dc820dbfe95ff6ba24cce0/android/src/main/java/bz/rxla/audioplayer/AudioplayerPlugin.java#L79-L84
Is there any reason for this?
It seems that if play is called again that a new instance will be created. But why not reuse it?
The text was updated successfully, but these errors were encountered: