Coder Social home page Coder Social logo

react-native-audio-streamer's People

Contributors

jerolimov avatar victor36max 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

react-native-audio-streamer's Issues

currentTime and duration features not working

Hi,
Looks like currentTime and duration features not working, they return 0. The duration method crash application.
Also would be great to know how to stop the audio?
Tested on
RN 32.1
Android and iOS platforms

Disabling cache

Audio cache is non-disablable feature, that wouldn`t be usefull for streaming apps, but its take really a lot of memory on the devices.

currentTime seems to be slower

My current issue is that the currentTime is moving, however if I run it against a normal clock it is much slower. Actually it seems that when the player run 5 seconds, in "real life" it has been 15 seconds.

I am running a setInterval every 1 second to update the screen and show the current time however I am not sure what is going on.

Audio cutting out (0.0.9)

I'm getting daily reports from users of my app (getlucid.com) that the audio cuts out intermittently and may or may not work after an app restart.

Has anyone experienced anything similar? Is this library being maintained or is there a different/better RN audio streaming solution out there?

Thanks!

issue

Hi! I get undefined is not an object (evaluating '_reactNativeAudioStreamer2.defaiult.setUrl')

I should note that I am a total noob at react native.
running react native 0.47.2 og mac os

Service killed if main activity cleaned up on Android

Hey so, if my main React Native application is cleared up by Android for memory, the service also stops. This kinda sucks because it means if they're listening to a song, it ends mid-way. I've tried as much as I can to lower the memory footprint of my app, but if I'm doing heavy browsing on multiple apps in the foreground, Android cleans it up.

Any idea how to tweak the code to keep the RNAudioStreamer service alive and avoid Android from killing it when it clears up memory from the main activity? I've been looking into:

  1. startForeground
  2. START_STICKY or START_REDELIVER_INTENT

Both might be helpful, but not sure where I'd throw those into the code...

audio file playing but not full length

Hi, first of all thanks for your great work =)

My issue:
when i start streaming an audio file the file is playing for 5/10s (it depends).
I try to share the audio file to WhatsApp to be sure thats its not a file problem and its working perfectly when the audio file are playing on WhatsApp.

Do you have any idea why this behaviour occurs?

Thks

"react-native-audio-streamer": "0.0.7"

Stop other apps playing music

Hello,

Is there any way to automatically stop any other app playing (i.e Spotify) when this player starts ?

Thank you

Why does not play?

Why does not this simple example play me?

	"react": "16.0.0-alpha.12",
	"react-native": "0.47.0",

Step 1
npm install react-native-audio-streamer --save

Step 2
react-native link react-native-audio-streamer

My source:

import React, { Component } from 'react'
import {
  AppRegistry,
  StyleSheet,
  Button,
  View
} from 'react-native'

import RNAudioStreamer from 'react-native-audio-streamer'

RNAudioStreamer.setUrl('http://lacavewebradio.chickenkiller.com:8000/stream.mp3')

export default class Stream extends Component {

  onPressPlay() {
    RNAudioStreamer.play()
  }

  render() {

    RNAudioStreamer.status((err, status)=>{
      if(!err) console.log(status)
    })

    return (
      <View style={styles.container}>
        <Button
          onPress={this.onPressPlay}
          title="PLAY"
          color="blue"
        />
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
})

AppRegistry.registerComponent('Stream', () => Stream)

Build Failed

  • What went wrong:
    Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:11:7-34
is also present at [:react-native-audio-streamer] AndroidManifest.xml:12:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:7:5-24:19 to override.

Playback is fast and choppy

Just got this working, I love how easy it was to setup and how minimal it is so that I can design my own player around it. However, the sound is terrible and I just want to make sure it's not something wrong with how I've set things up.

I'm running my app in Genymotion and I suspect that is the cause of the issue but I just want to be sure.

e: yeah the problem was related to emulation. switched to device debugging and it sounds amazing! excellent work. I'll leave this up and close it just in case anyone has this issue as well.

Getting undefined error

import React, { Component } from 'react'
import {
AppRegistry,
StyleSheet,
Button,
View
} from 'react-native'

import RNAudioStreamer from 'react-native-audio-streamer'

RNAudioStreamer.setUrl('http://lacavewebradio.chickenkiller.com:8000/stream.mp3')

export default class Stream extends Component {

onPressPlay() {
RNAudioStreamer.play()
}

render() {

RNAudioStreamer.status((err, status)=>{
  if(!err) console.log(status)
})

return (
  <View style={styles.container}>
    <Button
      onPress={this.onPressPlay}
      title="PLAY"
      color="blue"
    />
  </View>
)

}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
})

Getting Error

undefined is not an object (evaluating '_reactNativeAudioStreamer2.default.setUrl')

Network issues

I've noticed that if my network goes wonky or I lose signal, the songs get all messed up. They often stop halfway through. I've tried the following:

  1. Create a NetworkHelper to detect connectivity
  2. When the onLoadError fires, I use the NetworkHelper to determine if the phone is online.
  3. If it isn't online, I put the thread to sleep for 5 seconds and then try player.setPlayWhenReady(true)

This doesn't really seem to be that effective. Wondering what your thoughts are around this?

Also noticed that you guys are working in a much newer branch -- any plans to merge that into master?

Incompatibility with react native 0.48.x in iOS

I'm try to use this package in React Native version 0.48.4 and always have this error in iOS redefinition of 'RCTMethodInfo'

In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.m:13:
In file included from ../../react-native/React/Base/RCTEventDispatcher.h:12:
In file included from /Users/luciano/Library/Developer/Xcode/DerivedData/minutosDeSabedoria-azkedynizuzbsvfbgkbuwmswzege/Build/Products/Debug-iphonesimulator/include/React/RCTBridge.h:13:
/Users/luciano/Library/Developer/Xcode/DerivedData/minutosDeSabedoria-azkedynizuzbsvfbgkbuwmswzege/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:54:16: error: redefinition of 'RCTMethodInfo'
typedef struct RCTMethodInfo {
               ^
In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.m:9:
In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.h:10:
../../react-native/React/Base/RCTBridgeModule.h:54:16: note: previous definition is here
typedef struct RCTMethodInfo {
               ^
In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.m:13:
In file included from ../../react-native/React/Base/RCTEventDispatcher.h:12:
In file included from /Users/luciano/Library/Developer/Xcode/DerivedData/minutosDeSabedoria-azkedynizuzbsvfbgkbuwmswzege/Build/Products/Debug-iphonesimulator/include/React/RCTBridge.h:13:
/Users/luciano/Library/Developer/Xcode/DerivedData/minutosDeSabedoria-azkedynizuzbsvfbgkbuwmswzege/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:58:3: error: typedef redefinition with different types ('struct (anonymous struct at /Users/luciano/Library/Developer/Xcode/DerivedData/minutosDeSabedoria-azkedynizuzbsvfbgkbuwmswzege/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:54:16)' vs 'struct RCTMethodInfo')
} RCTMethodInfo;
  ^
In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.m:9:
In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.h:10:
../../react-native/React/Base/RCTBridgeModule.h:58:3: note: previous definition is here
} RCTMethodInfo;
  ^
In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.m:13:
In file included from ../../react-native/React/Base/RCTEventDispatcher.h:12:
In file included from /Users/luciano/Library/Developer/Xcode/DerivedData/minutosDeSabedoria-azkedynizuzbsvfbgkbuwmswzege/Build/Products/Debug-iphonesimulator/include/React/RCTBridge.h:13:
/Users/luciano/Library/Developer/Xcode/DerivedData/minutosDeSabedoria-azkedynizuzbsvfbgkbuwmswzege/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:65:11: warning: duplicate protocol definition of 'RCTBridgeModule' is ignored [-Wduplicate-protocol]
@protocol RCTBridgeModule <NSObject>
          ^
In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.m:9:
In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.h:10:
../../react-native/React/Base/RCTBridgeModule.h:65:11: note: previous definition is here
@protocol RCTBridgeModule <NSObject>
          ^
/Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.m:108:34: warning: 'sendDeviceEventWithName:body:' is deprecated: Subclass RCTEventEmitter instead [-Wdeprecated-declarations]
    [self.bridge.eventDispatcher sendDeviceEventWithName:@"RNAudioStreamerStatusChanged"
                                 ^
In file included from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.m:13:
../../react-native/React/Base/RCTEventDispatcher.h:84:1: note: 'sendDeviceEventWithName:body:' has been explicitly marked deprecated here
__deprecated_msg("Subclass RCTEventEmitter instead");
^
In module 'Foundation' imported from /Users/luciano/apps/App2Sales/minutosDeSabedoria/node_modules/react-native-audio-streamer/ios/RNAudioStreamer/RNAudioStreamer.h:9:
In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/sys/cdefs.h:180:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((deprecated(_msg)))
                                                      ^
2 warnings and 2 errors generated.

I created a fresh react native app and after react-native link react-native-audio-streamer build failed both in Xcode and react native cli.

Some advice to fix this problem?

ReferenceError: __DEV__ is not defined

Hello!
I faced with this issue after installing your module, please help me figure out.
The err looks this way:
ReferenceError: DEV is not defined (While processing preset: "/Users/roman/Work/TheUpperRoom/node_modules/react-native/Libraries/react-native/react-native.js")
at Object. (/Users/roman/Work/TheUpperRoom/node_modules/react-native/Libraries/react-native/react-native.js:15:5)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at /Users/roman/Work/TheUpperRoom/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:302:17
at Array.map (native)
TransformError: /Users/roman/Work/TheUpperRoom/node_modules/react-native-audio-streamer/index.js: DEV is not defined (While processing preset: "/Users/roman/Work/TheUpperRoom/node_modules/react-native/Libraries/react-native/react-native.js")

Background streaming and controls?

Hey Victor, been building a React Native audio app for a little while now, and every library I've bumped into struggles with background streaming + control (eg, playing next song while in background; lock screen controls).

Have you put any thought into these functions?

Issue know the current time

Hi :)
i'm trying to do a progress bar that use the percentage, so i need the duration and the currenti time. But i'm using a while loop that is not working, anyone can help?

_statusChanged(status) {
console.log(status);
RNAudioStreamer.duration((err, duration)=>{
if(!err){
console.log(duration);
this.setState({duration: duration});
} //seconds
})
while(status === 'PLAYING'){
RNAudioStreamer.currentTime((err, currentTime)=>{
if(!err){
console.log(currentTime);
this.setState({currentTime: currentTime});
}//seconds
})
}
}

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.