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

Remove player.prepare() of prepare() in android native module #162

Closed
wants to merge 1 commit into from

Conversation

kimxogus
Copy link
Contributor

@kimxogus kimxogus commented Apr 28, 2017

android.media.MediaPlayer.prepare() is not necessary because create() method call it automatically.
Also, player.prepare() code in RNSoundModule.java throws an exception with { code: -1, message: null } with my device (Galaxy S7 edge, Android 7.0) and avd (Android 6.0 Google APIs, x86).
Since I removed player.prepare(), the error has gone.

Copy link

@abdurrahmanekr abdurrahmanekr left a comment

Choose a reason for hiding this comment

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

it's worked, thank you @kimxogus

@razvangherghina
Copy link

+1

@januslo
Copy link

januslo commented May 4, 2017

I tested with MIUI and it works.

@lzctbyong
Copy link

lzctbyong commented May 7, 2017

tks, the same problem caused

@benvium
Copy link
Collaborator

benvium commented May 8, 2017

These changes have been added to #169, so if that one gets merged we can close this PR.

@benvium
Copy link
Collaborator

benvium commented May 8, 2017

Thanks for this - these changes have been merged in via #169 (that included your changes) so I'm closing.

@benvium benvium closed this May 8, 2017
@kimxogus kimxogus deleted the remove-prepare branch May 17, 2017 08:43
@kimxogus kimxogus restored the remove-prepare branch May 17, 2017 08:43
@ndbroadbent
Copy link
Contributor

ndbroadbent commented May 19, 2017

Hi, this change actually broke the new URL support for Android, so I can no longer load sounds from the network. prepare must be called in this section, because we are not always using the create() method to create a new MediaPlayer.

I'll send a PR for that.

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.

7 participants