Giter VIP home page Giter VIP logo

react-native-audio-streaming's Introduction

react-native-audio-streaming

THIS PROJECT IS NOT MAINTAINED

react-native-audio-streaming is not maintained anymore. The main purpose was to play shoutcast streams with meta data and display a notification while playing.

Please see other projects like

Features

  • Background audio streaming of remote stream
  • Control via sticky notification on android and media center on iOS
  • Shoutcast/Icy meta data support
  • Simple UI player component (if needed, an api to control the sound is available)

If you are only looking to play local audio file with app in foreground, please see other audio libs.

Demo iOS Demo android

First installation step (applied for both iOS & Android)

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

Next installation steps for iOS (choose one of three options below)

1. Cocoapods installation

  1. add pod 'RNAudioStreaming', :path => '../node_modules/react-native-audio-streaming' to Podfile
  2. run pod install

2. Mostly automatic installation

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

Go to node_modulesreact-native-audio-streaming => ios => Pods and drag/drop Pods.xcodeproj to the Libraries folder in your XCode project.

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

3. Manual installation

  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 to the Libraries folder in your XCode project
    • add Pods/Pods.xcodeproj to the Libraries folder in your XCode project
  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)

Final steps for iOS (required after doing any of three options above)

  1. Make sure $(SRCROOT)/../node_modules/react-native-audio-streaming/ios is added to your project's Header Search Paths within the Build Settings section.

  2. Update Info.plist file of your Xcode project and add audio background mode

    <key>UIBackgroundModes</key>
    <array>
      <string>audio</string>
    </array>

Next installation steps for Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.audioStreaming.ReactNativeAudioStreamingPackage; to the imports at the top of the file
  • Add new ReactNativeAudioStreamingPackage() to the list returned by the getPackages() method If you're using Android 23 or above
  • Add new ReactNativeAudioStreamingPackage(MainActivity.class) to he list returned by the getPackages()method instead.
  1. Append the following lines to android/settings.gradle:
    include ':react-native-audio-streaming'
    project(':react-native-audio-streaming').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-audio-streaming/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-audio-streaming')
    
  3. If using Proguard then insert the following rules:
    -keep class com.spoledge.aacdecoder.** {
     *;
    }
    

Usage

Playing sound (similar code used by the player UI)

import { ReactNativeAudioStreaming } from 'react-native-audio-streaming';

const url = "http://lacavewebradio.chickenkiller.com:8000/stream.mp3";
ReactNativeAudioStreaming.pause();
ReactNativeAudioStreaming.resume();
ReactNativeAudioStreaming.play(url, {showIniOSMediaCenter: true, showInAndroidNotifications: true});
ReactNativeAudioStreaming.stop();

For more information see the Example app.

Player UI

import { Player } from 'react-native-audio-streaming';

class PlayerUI extends Component {
  render() {
    return (
        <Player url={"http://lacavewebradio.chickenkiller.com:8000/stream.mp3"} />
    );
  }
}

TODO

  • Allow to play local files
  • Allow to specify custom style for the android notification (maybe a custom view ?)
  • Allow to specify custom styles for the player
  • Handle artwork of artist
  • Add tests

Credits

See also the list of contributors who participated in this project.

Contribute

Since symlink support is still lacking on React Native, I use the wml cli tool created by the nice folks at wix.

wml add ~/react-native-audio-streaming ~/react-native-audio-streaming/Example/node_modules/react-native-audio-streaming

License

This project is licensed under the MIT License - see the LICENSE file for details

react-native-audio-streaming's People

Contributors

adamliechty avatar bahaa96 avatar brettpappas avatar dininski avatar dmtrkovalenko avatar donedgardo avatar hiddentao avatar hudashot avatar indrekv avatar jsaucedo avatar kledk avatar naoto-ida avatar siriusdely avatar tavernari avatar tlenclos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-audio-streaming's Issues

Android notifcation player doesn't go away

When I close my app with app switcher (in android) the notifcation player doesn't go away, and the little 'x' button doesn't work.

I found a workaround though, just for everyone's information. In my android project I made a new service and used the method onTaskRemoved which gets called when the app is closed from the app switcher.

In that method I cancelled all the notifcations for the app, and voila! Will give more info if requested.

Making getStatus into a promise (ios)

Would you consider making the getStatus bridge function (https://github.com/tlenclos/react-native-audio-streaming/blob/master/ios/ReactNativeAudioStreaming.m#L175) return a promise instead of accepting a callback?

Or alternatively, to avoid a breaking api change make a new function with identical functionality which returns a promise?

Happy to submit a pull request if you're interested.

Reactnative reference: https://facebook.github.io/react-native/docs/native-modules-ios.html#promises

m4a playing fails on android

This is occurring both in my app and in the example app for me. When I try to play any m4a stream it fails with:

E/AACPlayer: playAsync():
java.lang.RuntimeException: Cannot start native decoder
at com.spoledge.aacdecoder.Decoder.start(Decoder.java:238)
at com.spoledge.aacdecoder.AACPlayer.playImpl(AACPlayer.java:424)
at com.spoledge.aacdecoder.AACPlayer.play(AACPlayer.java:386)
at com.spoledge.aacdecoder.AACPlayer.play(AACPlayer.java:338)
at com.spoledge.aacdecoder.AACPlayer$1.run(AACPlayer.java:296)
at java.lang.Thread.run(Thread.java:761)

Play file from firebase storage

My firebase uploaded file has the metadata set as audio/aac but does not play by either using the <Player> component or the APIs. Any help on how to make this work or any changes I could make to the project itself to get it to work?

Unable to run pod install

I get a cocoa error when running pod install:

untimeError - [Xcodeproj] Consistency issue: no parent for object `Main Group`: ``

can't get work with rn 0.31.0

Hello, thanks for your awesome plugin but i can not get work with rn 0.31.0, this is my package json

"dependencies": {
    "moment": "^2.13.0",
    "react": "15.2.1",
    "react-native": "0.31.0",
    "react-native-maps": "^0.7.1",
    "react-native-scrollable-tab-view": "^0.5.4",
    "react-native-share": "^1.0.16",
    "react-native-swiper": "^1.4.11",
    "react-native-vector-icons": "^2.0.3",
    "react-redux": "^4.4.5",
    "redux": "^3.5.2",
    "redux-thunk": "^2.1.0"
  }

logs

iMac-de-Dante:MiDiocesis dantecervantes$ npm install react-native-audio-streaming --save
npm WARN peerDependencies The peer dependency react-native@^0.30.0 included from react-native-audio-streaming will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "react-native-audio-streaming" "--save"
npm ERR! node v4.4.4
npm ERR! npm  v2.15.1
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants react-native@>=0.20.0
npm ERR! peerinvalid Peer [email protected] wants react-native@^0.30.0

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dantecervantes/Documents/react-native/MiDiocesis/npm-debug.log

Thanks!

How to stream audio file like url playback of youtube

Hi,

I want stream url playback of youtube like that:
https://r2---sn-a5meknl7.googlevideo.com/videoplayback?nh=IgpwcjAxLmxheDE2Kg43NC4xMjUuMTQ2LjE1MQ&requiressl=yes&mime=audio%2Fmp4&source=youtube&ip=69.172.229.21&dur=191.587&lmt=1478827186346730&key=yt6&ipbits=0&initcwndbps=10817500&id=o-AMl1uCvDZ-qKB2MIahvJJHQHsZ9H73NPfjWAZIOyYOqo&keepalive=yes&clen=3043844&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&gir=yes&ei=2NFfWJvtAs3a-gPLvpgY&ms=au&mt=1482674543&itag=140&mv=m&pl=22&upn=7qxOu7M0wWs&mn=sn-a5meknl7&mm=31&expire=1482696248&signature=B6294F2E997ABABCF93BF1959915F98BD24FBCFB.BAB2E825C2AA41A6BB2ABABEDF8E3FB3D07D046B&ratebypass=yes

how to using react-native-audio-streaming play this url, I'm newbie react native :)
help me thanks.

android - Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference

Hello guys,

i'm trying to build an app i made on iOS to Android, and i have this error at startup:

12-13 17:18:36.483  5384  5384 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at com.audioStreaming.ReactNativeAudioStreamingModule.getClassActivity(ReactNativeAudioStreamingModule.java:43)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at com.audioStreaming.Signal.setData(Signal.java:66)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at com.audioStreaming.ReactNativeAudioStreamingModule.onServiceConnected(ReactNativeAudioStreamingModule.java:78)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1223)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1240)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:739)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:95)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:148)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:5417)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
12-13 17:18:36.483  5384  5384 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
12-13 17:18:36.484   816  2166 W ActivityManager:   Force finishing activity com.app/.MainActivity

Do you have any idea?
Thanks!

"react-native-audio-streaming": "^2.2.0",
"react-native": "0.35.0",
"react": "15.3.2"

My MainApplication.java:

package com.app;

import android.app.Application;
import android.support.annotation.NonNull;
import android.util.Log;

import com.facebook.react.ReactApplication;
import com.reactnativenavigation.NavigationApplication;
import com.wog.videoplayer.VideoPlayerPackage;
import com.cmcewen.blurview.BlurViewPackage;
import com.audioStreaming.ReactNativeAudioStreamingPackage;
import com.rnim.rn.audio.ReactNativeAudioPackage;
import com.brentvatne.react.ReactVideoPackage;
import fr.bamlab.rnimageresizer.ImageResizerPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.microsoft.codepush.react.CodePush;
import com.geektime.reactnativeonesignal.ReactNativeOneSignalPackage;
import com.imagepicker.ImagePickerPackage;
import com.RNFetchBlob.RNFetchBlobPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends NavigationApplication {

  @Override
  public boolean isDebug() {
      return BuildConfig.DEBUG;
  }

  @NonNull
  @Override
  public List<ReactPackage> createAdditionalReactPackages() {
      return Arrays.<ReactPackage>asList(
          new VideoPlayerPackage(),
          new BlurViewPackage(),
          new ReactNativeAudioStreamingPackage(),
          new ReactNativeAudioPackage(),
          new ReactVideoPackage(),
          new ImageResizerPackage(),
          new PickerPackage(),
          new CodePush(null, getApplicationContext(), BuildConfig.DEBUG),
          new ReactNativeOneSignalPackage(),
          new ImagePickerPackage(),
          new RNFetchBlobPackage(),
          new VectorIconsPackage()
      );
  }
}

Have anyone tried with s3 and cloudfront streaming

I tried this project with set of static http streaming end points, but in my project I'll be using cloudfront streaming in which the files resides in s3 and an rtmp endpoint is created. I guess the player doesn't supports rtmp now. is there a way to solve this problem? Or is there a way to stream http from s3 and cloudfront?

Can we make notification on android and media center control on iOS optional ?

Was wondering if the play method can take extra parameter to control notification on android and media center on ios ?

currently the default behavior is to always show notification and there is no way to override it ?

Are there any plans for such enhancements for this library ? I really like this library and hope to see this enhancement of optional notifications/media center control. If you agree, I can work on a PR

Add a callback?

It would be interesting to add a callback in order to execute another function after the play function is executed. I think about loading name/artwork song after loading music in player. Today, I use setTimeout.

Android get URL of current track like iOS

Hey.

I'm instantiating a list of player on a react native page.
The goal is to display a list of question and let the user play the response of the question.

In peculiar if the user play a question, then click another question, it should stop the first and start the second.

When the user click on the question, onPress is called.

onAudioEvt = (evt: any) => {
    switch (evt.status) {
      case PLAYING:
        if (evt.url === this.getUrl()) {
          this.setState({ playing : true });
        } else {
          this.setState({ playing : false });
          this.subscription.remove();
          delete this.subscription;
        }
        break;
      case STOPPED:
      case ERROR:
        this.setState({ playing : false });
        this.subscription.remove();
        delete this.subscription;
        break;
    }
  }

  onPress = () => {
    if (!this.subscription) {
      this.subscription = DeviceEventEmitter.addListener('AudioBridgeEvent', this.onAudioEvt);
      ReactNativeAudioStreaming.play(this.getUrl(), {});
    } else {
      ReactNativeAudioStreaming.stop();
    }
  }

In ios this works fine because evt contain an url props (and also a duration that I ulse elsewhere but that is an other issue.

Is there a way on android to get the event current url ??

Not able to install.....

Hi All,

I am getting bellow error while installing in my app....

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/Cellar/node/7.1.0/bin/node" "/usr/local/bin/npm" "install" "react-native-audio-streaming" "--save"
npm ERR! node v7.1.0
npm ERR! npm v3.10.9

npm ERR! shasum check failed for /var/folders/rs/30mhv4tn0gz3r05ls8h3bghr0000gn/T/npm-65450-120bf1d9/registry.npmjs.org/react-native-audio-streaming/-/react-native-audio-streaming-2.2.0.tgz
npm ERR! Expected: b02552893480c83281a19bbf2203927ec642c9f4
npm ERR! Actual: ea7da3714c97383eb2d295f66a237f7bd386a967
npm ERR! From: https://registry.npmjs.org/react-native-audio-streaming/-/react-native-audio-streaming-2.2.0.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:

Where do I get libStreamingKit.a?

I'm trying to follow this instruction:

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

My list under "Link Binary With Libraries" already includes libReactNativeAudioStreaming.a. (I'm guessing this is due to the react-native link react-native-audio-streaming command I ran.)

However, libStreamingKit.a is not there. I clicked the "+", which prompted me to find it. But I don't know where to find it. There is nothing in the repository with this name.

Supported audio types

This issue is similar to tumtumtum/StreamingKit#301 that I opened yesterday:

"I've gathered from issues on here and the examples you've included that these are the formats/codecs that are supported:

mp4 audio (m4a)
mp3
aac
wav
aiff (?)

Is this the case? Either way, could you do a quick update of the readme to get this info documented? It would be a huge help for me and probably other users of this excellent library."

I noticed that the iOS version of this library relies mainly on StreamingKit, so what I said applies to this library as well.

Thanks! Great work!

not able to control play/pause remotely using earbuds

hi there,
Thanks for your work!
I was referring to your work in implementing my audio player (especially now playing part)
and I was able to play prev/next song using earbuds (by pressing 2/3 times respectively)
but not play/pause (by pressing only once)

both playing prev/next song and play/pause work from now playing if i do it on device.

any comment will be appreciated!!
thanks!

Readme

Hello, in README.md change

Add new ReactNativeAudioStreamingPackage() to the list returned by the getPackages() method

by

Add new ReactNativeAudioStreamingPackage(MainActivity.class) to the list returned by the getPackages() method

Android playback issues.

There are several issues with playback on Android.

First, even in the example app, only the .mp3 stream will actually play. The other streams show the loading indicator for a brief period and then nothing. I am assuming this is some issue with file type support in the old player implementation.

Second, the pause and resume functionality does not work at all.

What is the status of the ExoPlayer implementation? Is it close to releasable? I would like to use your library but it is unusable on Android at the moment.

Playback of local files?

Does this library support playback from local files or only remote ones? Could you document support (or lack of) in the readme? Thanks so much!

exoplayer branch

When i switch on the exo player branch stuff gets broken.

node_modules\react-native-audio-streaming\android\src\audioStreaming\Signal.java:211: error: cannot find symbol
DataSource.Factory dataSourceFactory = new AudioStreamingD
(this.getApplication(), getDefaultUserAgent(), bandwidthMeter);
^
symbol: class AudioStreamingDataSourceFactory
location: class Signal
error
react-native-audio-streaming:compileReleaseJavaWithJavac FAILED

I need to stream m4a so i need to make this branch working.
Any ideas?

Error while building

While using the Automatic Installation i'm getting an error while building my project:

Lexical or Preprocessor Issue
'/...../StreamingKit-prefix.pch' file not found

Any idea ?

Edit
I simple deleted the folder from node_modules and re-run npm install

undefined is not an object (evaluating 'ReactNativeAudioStreaming.getStatus')

I'm trying to add the player to the sample app that react creates and am getting an exception when running iOS. I installed react-native-audio-streaming using the cocoapod technique and specified the background audio setting.

My component looks like:

import React, { Component } from 'react';
import {
  StyleSheet,
  Text,
  View
} from 'react-native';
import { Player } from 'react-native-audio-streaming';

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
        <Text style={styles.instructions}>
          To get started, edit index.ios.js
        </Text>
        <Text style={styles.instructions}>
          Press Cmd+R to reload,{'\n'}
          Cmd+D or shake for dev menu
        </Text>
        <Player url={"http://lacavewebradio.chickenkiller.com:8000/stream.mp3"} />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

I'm very new to react-native and ios development, so I could very well be missing something trivial :)

Where do I get Pods.xcodeproj?

I'm trying to understand this instruction:

Go to node_modules ➜ react-native-audio-streaming => ios and add Pods.xcodeproj

Where do I get the Pods.xcodeproj from? Should I copy it from the Example/ directory?

iOS build error: STKAudioPlayer.h not found

I keep getting "STKAudioPlayer.h not found" on line 5 of ReactNativeAudioStreaming.h when trying to build the Example project for iOS.

I cloned this repo, ran npm install in the Example folder, opened ios/Example.xcodeproj and tried to build in XCode. Got the aforementioned error.

I tried cloning it again, running npm install followed by react-native link react-native-audio-streaming (it told me the library was already linked for both platforms). Opening the XCode project and trying to build produced the same error.

Should that work? That isn't working for me. Is it working for you?

How to debug?

How would I go with debugging? I have set up everything but if I click on the Play Button the Activity Indicator spins forever and nothing is happening. I don't even know where I should start with looking for the error.

Not working with react-native-navigation

Module is working fine when put in a new project(android) but I get undefined ReactNativeAudioStreaming from NativeModules when I try to use it with react-native-navigation module.

Is it possible that there is some kind of conflict?

ReactNativeAudioStreaming.resume() restarts the song?

First I fire:

            ReactNativeAudioStreaming.play(url,{
                showIniOSMediaCenter: true,
                showInAndroidNotifications: true
            })

Then I hit fire ReactNativeAudioStreaming.pause(), which stops the track.
After that, I fire ReactNativeAudioStreaming.resume() and the track restarts. I'm assuming that's not the expected behavior?

AACPlayer issue when playing certain stream on Android

Hi, I just manage to spot a difficult to reproduce problem on Android.

Steps I did to see the problem

  1. Upload a acc to AWS S3 using react-native-audio to record the AAC and RN XMLHttpRequest to serve
  2. Be sure that it is serve from aws S3 (no cloudfront in beetween) with content type AAC
  3. Use react-native-audio-streaming to play the content
  4. See it does nothing

Sometimes, with some file or after a delay (?? not sure about it) It does manage to play the file, but sometimes it fail, so it is hard to reproduce. Note that the same file work perfectly on iOS

Debug message

As I was able to find a bugging case on a real android device (ZTE Axon Pro Android 5.0.2 and kernel 3.10.49 on a Qualcomm810 processor), I did get the following pidcat bug (with redacted private header that content private metadata).

screen shot 2016-11-18 at 15 49 19

This seems to be related to this line:
https://github.com/vbartacek/aacdecoder-android/blob/master/decoder/jni/aac-decoder/aac-decoder.c#L427

I'm pretty noob with aac, but I read somewhere in the net that it can be because my file as an ADIF header instead of an ADTS and thus vbartacek/aacdecoder-android can't read it

Hope you have enough info to help me.

Install failed

I am trying to install this but when I am in Xcode -> Build Phases I can't find libStreamingKit.a.

I followed the instructions for "Mostly Automatic" install. Can you explain what you mean by "add Pods.xcodeproj"? Am I supposed to just make a folder called Pods.xcodeproj?

App crashes on Android when Notifications set to false

Everything seems to work fine with Notifications enabled, but as soon as I turn them off, the app crashes on play(). Here is the error log:

             --------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: Thread-189
  Process: com.girondins, PID: 2705
  java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.RemoteViews.setTextViewText(int, java.lang.CharSequence)' on a null object reference
    at com.audioStreaming.Signal.playerMetadata(Signal.java:333)
    at com.spoledge.aacdecoder.IcyInputStream.parseMetadata(IcyInputStream.java:231)
    at com.spoledge.aacdecoder.IcyInputStream.fetchMetadata(IcyInputStream.java:205)
    at com.spoledge.aacdecoder.IcyInputStream.read(IcyInputStream.java:133)
    at com.spoledge.aacdecoder.BufferReader.run(BufferReader.java:155)
    at java.lang.Thread.run(Thread.java:818)

I did a simple ReactNativeAudioStreaming.play(url, { showIniOSMediaCenter: true, showInAndroidNotifications: false });

CFNetwork SSLHandshake failed (-9824)

Hello,

I keep getting the error CFNetwork SSLHandshake failed (-9824) in the Xcode console. I have googled already and my Info.plist looks like this:

  <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
      <key>NSExceptionDomains</key>
      <dict>
          <key>my_domain.com</key>
          <dict>
              <key>NSIncludesSubdomains</key>
              <true/>
              <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
              <true/>
              <key>NSTemporaryExceptionMinimumTLSVersion</key>
              <string>TLSv1.0</string>
              <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
              <false/>
          </dict>
          <key>localhost</key>
          <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
          </dict>
      </dict>
  </dict>

But that didn't help. Has anyone experienced this also and found a solution?

Can't get to work in Android 23

Hey there, I just folowed those steps in README but I can't get the app to run in Android.

Tha'ts the error I got:

:app:compileDebugJavaWithJavac
/Users/myuser/MyApp/android/app/src/main/java/com/anansimobile/MainApplication.java:28: error: constructor ReactNativeAudioStreamingPackage in class ReactNativeAudioStreamingPackage cannot be applied to given types;
            new ReactNativeAudioStreamingPackage()
            ^
  required: Class<?>
  found: no arguments
  reason: actual and formal argument lists differ in length
1 error
:app:compileDebugJavaWithJavac FAILED

How my MainApplication.java looks like:

package com.anansimobile;

import android.app.Application;
import android.util.Log;

import com.facebook.react.ReactApplication;
import com.audioStreaming.ReactNativeAudioStreamingPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    protected boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new ReactNativeAudioStreamingPackage()
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
      return mReactNativeHost;
  }
}

RN 0.39.2 Playback error: Wrong # arguments

"ReactNativeAudioStreaming. was called with 1 arguments, but expects 2. If you haven't changed this method yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away."
Any ideas? Thanks!

[Android] ReactNativeAudioStreamingModule.getClassActivity null pointer exception

Hi,

I'm getting the following crash reports from Fabric Crashlytics on Android (version 4.x.x, 5.x.x & 6.x.x) with [email protected]:

Fatal Exception: java.lang.NullPointerException
       at com.audioStreaming.ReactNativeAudioStreamingModule.getClassActivity(ReactNativeAudioStreamingModule.java:43)
       at com.audioStreaming.Signal.setData(Signal.java:66)
       at com.audioStreaming.ReactNativeAudioStreamingModule.onServiceConnected(ReactNativeAudioStreamingModule.java:78)
       at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1140)
       at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1157)
       at android.os.Handler.handleCallback(Handler.java:808)
       at android.os.Handler.dispatchMessage(Handler.java:103)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:5315)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
       at dalvik.system.NativeStart.main(NativeStart.java)

Haven't been able to reproduce myself, but 6 users on different phones already had it.
Unfortunately I don't know enough java to submit a PR.

Any plans for "seek" function or a "progress" listener?

I have used other platforms (Titanium) for playing audio in an app and one critical feature that I am not able to do with this module is to allow someone to "seek" to a certain spot of the audio file. I have done this from a UI standpoint using a scrubber since I knew the length of the audio (number of seconds).

I was also able to display the status of how far along the audio was using a event listener that returned the current progress.

Are these type of features planned?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.