{"id":4654,"url":"https://github.com/tlenclos/react-native-audio-streaming","last_synced_at":"2025-05-15T18:08:56.085Z","repository":{"id":9947640,"uuid":"63879105","full_name":"tlenclos/react-native-audio-streaming","owner":"tlenclos","description":"iOS \u0026 Android react native module to play an audio stream, with background support and media controls","archived":false,"fork":false,"pushed_at":"2022-04-09T01:31:36.000Z","size":4692,"stargazers_count":785,"open_issues_count":86,"forks_count":254,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-12T18:51:31.508Z","etag":null,"topics":["android","audio","ios","player","react-native","shoutcast","streaming"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tlenclos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-21T15:03:41.000Z","updated_at":"2025-05-06T05:29:34.000Z","dependencies_parsed_at":"2022-08-07T05:15:20.852Z","dependency_job_id":null,"html_url":"https://github.com/tlenclos/react-native-audio-streaming","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlenclos%2Freact-native-audio-streaming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlenclos%2Freact-native-audio-streaming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlenclos%2Freact-native-audio-streaming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlenclos%2Freact-native-audio-streaming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tlenclos","download_url":"https://codeload.github.com/tlenclos/react-native-audio-streaming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394722,"owners_count":22063984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","audio","ios","player","react-native","shoutcast","streaming"],"created_at":"2024-01-05T20:17:19.183Z","updated_at":"2025-05-15T18:08:56.043Z","avatar_url":"https://github.com/tlenclos.png","language":"Java","funding_links":[],"categories":["Components","Java"],"sub_categories":["Media"],"readme":"\n# react-native-audio-streaming\n\n## THIS PROJECT IS NOT MAINTAINED\n\nreact-native-audio-streaming is not maintained anymore. The main purpose was to play shoutcast streams with meta data and display a notification while playing.\n\nPlease see other projects like\n\n- [jsierles/react-native-audio](https://github.com/jsierles/react-native-audio) to play local audio and record\n- [zmxv/react-native-sound](https://github.com/zmxv/react-native-sound) to play local audio with more controls\n\n## Features\n\n- Background audio streaming of remote stream\n- Control via sticky notification on android and media center on iOS\n- Shoutcast/Icy meta data support\n- Simple UI player component (if needed, an api to control the sound is available)\n\nIf you are only looking to play local audio file with app in foreground, please [see other audio libs](https://github.com/tlenclos/react-native-audio-streaming/blob/master/README.md#other-rn-audio-projects).\n\n![Demo iOS](https://raw.githubusercontent.com/tlenclos/react-native-audio-streaming/master/demo_ios.gif)\n![Demo android](https://raw.githubusercontent.com/tlenclos/react-native-audio-streaming/master/demo_android.gif)\n\n## First installation step (applied for both iOS \u0026 Android)\n\n`$ npm install react-native-audio-streaming --save`\n\n### Next installation steps for iOS (choose one of three options below)\n\n#### 1. Cocoapods installation\n\n1. add `pod 'RNAudioStreaming', :path =\u003e '../node_modules/react-native-audio-streaming'` to `Podfile`\n2. run `pod install`\n\n#### 2. Mostly automatic installation\n\n`$ react-native link react-native-audio-streaming`\n\nGo to `node_modules` ➜ `react-native-audio-streaming` =\u003e `ios` =\u003e `Pods` and drag/drop `Pods.xcodeproj` to the Libraries folder in your XCode project.\n\nIn XCode, in the project navigator, select your project. Add `libReactNativeAudioStreaming.a` and `libStreamingKit.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n\n#### 3. Manual installation\n\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `react-native-audio-streaming` =\u003e `ios`\n   - run `pod install` to download StreamingKit dependency\n   - add `ReactNativeAudioStreaming.xcodeproj` to the Libraries folder in your XCode project\n   - add `Pods/Pods.xcodeproj` to the Libraries folder in your XCode project\n3. In XCode, in the project navigator, select your project. Add `libReactNativeAudioStreaming.a` and `libStreamingKit.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n4. Run your project (`Cmd+R`)\n\n### Final steps for iOS (required after doing any of three options above)\n\n1. Make sure `$(SRCROOT)/../node_modules/react-native-audio-streaming/ios` is added to your project's `Header Search Paths` within the `Build Settings` section.\n\n2. Update Info.plist file of your Xcode project and add audio background mode\n\n```xml\n    \u003ckey\u003eUIBackgroundModes\u003c/key\u003e\n    \u003carray\u003e\n      \u003cstring\u003eaudio\u003c/string\u003e\n    \u003c/array\u003e\n```\n\n### Next installation steps for Android\n\n1. Open up `android/app/src/main/java/[...]/MainApplication.java`\n  - Add `import com.audioStreaming.ReactNativeAudioStreamingPackage;` to the imports at the top of the file\n  - Add `new ReactNativeAudioStreamingPackage()` to the list returned by the `getPackages()` method\n  If you're using Android 23 or above\n  - Add `new ReactNativeAudioStreamingPackage(MainActivity.class)` to he list returned by the `getPackages()`method instead.\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-audio-streaming'\n  \tproject(':react-native-audio-streaming').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-audio-streaming/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':react-native-audio-streaming')\n  \t```\n4. If using Proguard then insert the following rules:\n   ```\n   -keep class com.spoledge.aacdecoder.** {\n    *;\n   }\n   ```\n\n   \n   \n## Usage\n\n### Playing sound (similar code used by the player UI)\n\n```javascript\nimport { ReactNativeAudioStreaming } from 'react-native-audio-streaming';\n\nconst url = \"http://lacavewebradio.chickenkiller.com:8000/stream.mp3\";\nReactNativeAudioStreaming.pause();\nReactNativeAudioStreaming.resume();\nReactNativeAudioStreaming.play(url, {showIniOSMediaCenter: true, showInAndroidNotifications: true});\nReactNativeAudioStreaming.stop();\n```\n\nFor more information see the Example app.\n\n### Player UI\n\n```javascript\nimport { Player } from 'react-native-audio-streaming';\n\nclass PlayerUI extends Component {\n  render() {\n    return (\n        \u003cPlayer url={\"http://lacavewebradio.chickenkiller.com:8000/stream.mp3\"} /\u003e\n    );\n  }\n}\n```\n\n## TODO\n\n- [ ] Allow to play local files\n- [ ] Allow to specify custom style for the android notification (maybe a custom view ?)\n- [ ] Allow to specify custom styles for the player\n- [ ] Handle artwork of artist\n- [ ] Add tests\n\n## Credits\n\n- Android version based on the work of @EstebanFuentealba https://github.com/EstebanFuentealba/react-native-android-audio-streaming-aac\n- iOS version based on the work of @jhabdas https://github.com/jhabdas/lumpen-radio\n\nSee also the list of [contributors](https://github.com/tlenclos/react-native-audio-streaming/graphs/contributors) who participated in this project.\n\n## Contribute\n\nSince symlink support is [still lacking](https://github.com/facebook/react-native/issues/637) on React Native, I use the [wml](https://github.com/wix/wml) cli tool created by the nice folks at wix.\n\n`wml add ~/react-native-audio-streaming ~/react-native-audio-streaming/Example/node_modules/react-native-audio-streaming`\n\n## [Changelog](https://github.com/tlenclos/react-native-audio-streaming/blob/master/CHANGELOG.md)\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlenclos%2Freact-native-audio-streaming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlenclos%2Freact-native-audio-streaming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlenclos%2Freact-native-audio-streaming/lists"}