-
Notifications
You must be signed in to change notification settings - Fork 756
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
v1.0.0 #713
v1.0.0 #713
Conversation
Hey @antoine-pous! |
@Pawelsas I'm not a maintainer, actually I need some help to test everything and see how to implement CI. I'm new to React Native then many things remain a bit hard to understand. Feel free to use it following instructions and report any issue directly on this PR, I'll check about them ASAP :) |
@antoine-pous really cool! I haven't looked in the implementation details yet. Are you planning to update the preloading and memory handling on Android as well? After some research I noticed that audio preloading and/or playback will fail at some point when you either preload to many sounds or play too many sounds within one session. |
I never reached it, then i don't know how to deal with it :') |
Thank you Antoine for your amazing work. It looks like a very good start for keeping react-native-sound. |
@RomualdPercereau I've not updated this PR since a while, but I think it will be more easy to fix any issue now. My project moved from RN to UE4, but don't hesitate to ping me if you need some help for fixes 👍 I hope this PR will ensure the future of this package :) |
Thank you @antoine-pous, your work is a very good start for the next versions. I moved it in a new branch : https://github.com/zmxv/react-native-sound/tree/1.0.0. I was wondering why, the functions not related to a specific sound like: It should probably be the same for The new usage would be:
|
Maybe would it be better to wrap those functions in Sound class and move tracks in a Track class, then into the Sound class you maintain a map of the whole loaded sounds and everything can be managed from the Sound class :) |
Yes, could be a way to have a dedicated namespace for these functions. It could give this kind of implementation. I don't know if Sound should be default in that case? @antoine-pous
|
This is a work in progress, it need some fixes and requires a lot of tests.
What's new:
rejectOnUnsupportedFeature {Boolean}
which ensure that using an unsupported feature will be rejected. If disabled (default behavior) the function will be resolvedenable
/disable
setSpeakerphoneOn
/setSpeakerphoneOff
enableInSilenceMode
/disableInSilenceMode
setActive
/setInactive
SoundBasePath
type which can be'MAIN_BUNDLE' | 'DOCUMENT' | 'LIBRARY' | 'CACHES' | string
SoundOptions
interface withrejectOnUnsupportedFeature?: boolean
andenableSMTCIntegration?: boolean
RNSoundModule.createMediaPlayer
will execute the callback error with more explicit messages.Resource not found
covered too much errors, this update will give a better view of what's happening exactly.Resource not found
remain as last error when the function is not able to determine which action is requested, maybe should we put a better error message. Error payload have also a new key namedresource
which provide the full path of the fetched file to enhance debugging.Known issues
IsAndroid
istrue
predefined directories areundefined
using React Native with ExpoRemaining changes:
This is clearly a braking change and i don't see any reason to continue to support legacy stuff when most of supported versions of RN, by this lib, are not supported anymore. If people are not able to upgrade their dependencies and follow the new standards it's sad but IMO a library must remain updated, they can still use legacy versions of the library if needed.
Feel free to suggest any changes, i need this update then i'll finish it ASAP
To test it in your projects:
Using Yarn:
yarn add antoine-pous/react-native-sound#1.0.0
Using NPM:
npm install git://github.com/antoine-pous/react-native-sound.git#1.0.0 --save
Usage example