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

Android Support #6

Open
ghost opened this issue Sep 15, 2015 · 8 comments
Open

Android Support #6

ghost opened this issue Sep 15, 2015 · 8 comments

Comments

@ghost
Copy link

ghost commented Sep 15, 2015

No description provided.

@Sh3rawi
Copy link
Contributor

Sh3rawi commented Oct 8, 2015

I have a pull request that is nearly complete(btw thanks for your device info module, helped me alot with this). The thing is, from what i've seen/tried: when playing an audio file from within android's own media player utility, you should write the name of the file without its extension ('beep"). However, the iOS implementation in this module requires an extension to play the sound("beep.mp3").
If im not missing anything, one of the two platforms' implementation must be changed to have unified function calls, no?

@ghost
Copy link
Author

ghost commented Oct 9, 2015

What about making the JS api require the file extension but then remove it automatically, if we're on android?

@andreaskeller
Copy link
Owner

@rebeccahughes that could be a possible solution. @Sh3rawi I have seen you published the android code as your own package (react-native-audio-player). I am currently developing the android versions of the app where I have used initally this audio player. So your work comes in handy for me. Do you still plan to send a pull request? I would appreciate to include your work into this repository as the two interfaces are really similar.

@Sh3rawi
Copy link
Contributor

Sh3rawi commented Oct 9, 2015

@andreaskeller Yes I still want to do it. Could JS know what platform we are on without using an extra module as @rebeccahughes 's ? Or how about we let Android do the removal ? If we finish this the pull request would be ready.

@andreaskeller
Copy link
Owner

@Sh3rawi from javascript you could do something like

if (Platform.OS === 'ios') {
// ios code
} else if (Platform.OS === 'android') {
// android code
}

or put the different parts into files *.ios.js and *.android.js.

But I think I would prefer if you would just remove the extension in the android java code. what do you think?

@Sh3rawi
Copy link
Contributor

Sh3rawi commented Oct 9, 2015

Hmm. I guess doing it with the the Platform module is better as it also clarifies to anyone who wants to use the module and opens the JS file to see the api, to also directly see the manipulation - even without reading the docs. No ?

@andreaskeller
Copy link
Owner

Sounds good to me.

@Sh3rawi
Copy link
Contributor

Sh3rawi commented Oct 9, 2015

Very well then. I'll check that everything is good and running to submit the PR.

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

No branches or pull requests

2 participants