Skip to content
React Native Android module audio streaming AAC
Branch: master
Clone or download
Latest commit f70f7d2 Sep 30, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example update version Sep 30, 2015
libs First commit Sep 27, 2015
src/main update readme Sep 29, 2015
.gitignore Agregada notificacion Sep 28, 2015
LICENSE Initial commit Sep 27, 2015
README.md update readme Sep 29, 2015
build.gradle First commit Sep 27, 2015
index.android.js First commit Sep 27, 2015
package.json update version Sep 30, 2015

README.md

React Native Android Audio Streaming AAC

A react native wrapper for aacdecoder-android.

Setup

  • android/settings.gradle
...
include ':react-native-android-audio-streaming-aac'
project(':react-native-android-audio-streaming-aac').projectDir = new File(settingsDir, '../node_modules/react-native-android-audio-streaming-aac')
  • android/app/build.gradle
...
dependencies {
    ...
    compile project(':react-native-android-audio-streaming-aac')
}
  • register module (in MainActivity.java)
import cl.json.react.AACStreamingPackage;  // <--- import

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {

  ......

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
      .setApplication(getApplication())
      .setBundleAssetName("index.android.bundle")
      .setJSMainModuleName("index.android")
      .addPackage(new MainReactPackage())
      .addPackage(new AACStreamingPackage(MainActivity.class))      // <------- add package
      .setUseDeveloperSupport(BuildConfig.DEBUG)
      .setInitialLifecycleState(LifecycleState.RESUMED)
      .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null);

    setContentView(mReactRootView);
  }

  ......

}

Usage

var AACStreamingAndroid = require('react-native-android-audio-streaming-aac');

AACStreamingAndroid.setURLStreaming('http://tunein.digitalproserver.com/bioconcebb.aac');
AACStreamingAndroid.play();

Run example

  • cd example
  • npm install
  • react-native start another tab
  • react-native run-android
You can’t perform that action at this time.