indiecastfm / react-native-audio-streamer

A react-native audio streaming module which works on both iOS & Android
MIT License
132 stars 50 forks source link

Getting undefined error #25

Open kannanseeni opened 6 years ago

kannanseeni commented 6 years ago

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')

juanstein commented 5 years ago

I'm having the same issue. Were you able to solve it?

wdayanand commented 5 years ago

work perfect on android but not working on ios

assoumemba commented 5 years ago

I have the same error.

image

I follow all steps.

see my code here:

import React, { Component } from 'react'; import { Alert, AppRegistry, Button, StyleSheet, View } from 'react-native'; import RNAudioStreamer from 'react-native-audio-streamer';

export default class RadioPlayer extends Component {

_onPressButton() { Alert.alert('You tapped the button!') }

_onPressPlay() {

RNAudioStreamer.setUrl('https://audioboom.com/posts/5766044-follow-up-305.mp3');
RNAudioStreamer.play();   

}

_onPressPause(){ RNAudioStreamer.pause(); }

render() { return (

Faisal-Manzer commented 5 years ago

+1

wazapenJr commented 5 years ago

@wdayanand work perfect on android but not working on ios

How did you build it on android? I have this issue

raouldandresy commented 4 years ago

Did you find any solution on IOS?