{"repo":"johnsonsu/react-native-sound-player","free":true,"listed":false,"github":"https://github.com/johnsonsu/react-native-sound-player","clone":"git clone https://github.com/johnsonsu/react-native-sound-player.git","description":"Play sound file in ReactNative","language":"Java","stars":285,"topics":["react-native","sound","player","sound-files","audio","audio-player","streaming-audio"],"license":"MIT","category":"mobile-apps","readme_excerpt":"react-native-sound-player ⚠️ This package is no longer actively maintained. For new projects, I recommend using other libraries such as react-native-track-player which provides more comprehensive audio playback features and active community support. Play audio files, stream audio from URL, using ReactNative. Installation 1. yarn or npm 2. Link For RN = 0.60 you can skip this step. Usage Play sound with file name and type 1. Add sound files to iOS/Android. - On iOS, drag and drop sound file into project in Xcode. Remember to check \"Copy items if needed\" option and \"Add to targets\" . - On Android, put sound files in {project root}/android/app/src/main/res/raw/ . Just create the folder if it doesn't exist. - When using playAsset() you only need to copy the file to the projects root directory or a subfolder like assets 2. Import the library and call the playSoundFile(fileName, fileType) function: Please note that the device can still go to sleep (screen goes off) while audio is playing. When this happens, the audio will stop playing. To prevent this, you can use something like react-native-keep-awake. Or alternatively, for iOS, you can add a Background Mode of Audio, AirPlay, and Picture in Picture in XCode. To do this, select your application from Targets, then click on Signing & Capabilities and add Background Modes . once the options for it appear on your Signing & Capabilities page select the checkbox with Audio, AirPlay, and Picture in Picture . This will allow the applicati","default_branch":null,"files":null,"tree":[],"storefront":"/r/johnsonsu","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/johnsonsu/react-native-sound-player/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}