Skip to content

egm0121/react-native-audio-streaming

 
 

Repository files navigation

egm0121-react-native-audio-streaming

Usage

creating a player instance

import { ReactNativeStreamingPlayer } from 'egm0121-react-native-audio-streaming';

const player = new ReactNativeStreamingPlayer();

player.setSoundUrl("http://mydemowebsite.com/stream.mp3");
player.play();
player.pause();
player.resume();

player.getStatus((err,data) => {
  let progress = parseFloat(data.progress);
  let duration = parseFloat(data.duration);
});

player.on('stateChange',(evt) => {});
player.on('RemoteControlEvents',(evt) => {});
player.on('AudioRouteInterruptionEvent',(evt) => {});

player.destroy();

Getting started

$ npm install react-native-audio-streaming --save

Mostly automatic installation

$ react-native link react-native-audio-streaming

Go to node_modulesreact-native-audio-streaming => ios and add Pods.xcodeproj

In XCode, in the project navigator, select your project. Add libReactNativeAudioStreaming.a and libStreamingKit.a to your project's Build PhasesLink Binary With Libraries

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-audio-streaming => ios
    • run pod install to download StreamingKit dependency
    • add ReactNativeAudioStreaming.xcodeproj
    • add Pods/Pods.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libReactNativeAudioStreaming.a and libStreamingKit.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)

Credits

About

iOS only fork of react-native-audio-streaming allows multiple player instances, with background support and media controls

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Objective-C 45.4%
  • Java 34.7%
  • JavaScript 17.2%
  • Python 2.5%
  • Ruby 0.2%