Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

Why does not play? #16

Open
gHashTag opened this issue Oct 13, 2017 · 6 comments
Open

Why does not play? #16

gHashTag opened this issue Oct 13, 2017 · 6 comments

Comments

@gHashTag
Copy link

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)
@salisuabubakar
Copy link

Yes i did the same and its not working. Can someone please help us. Thanks

@lucasltv
Copy link

The links (URL) is offline bro... Has 404 error.

@NimishGopal
Copy link

I have a working url but still it does not play in android but that url plays in browser
react-native: 0.52

@sfratini
Copy link

sfratini commented Mar 6, 2018

Mine does not work in the emulator but it works on the device. Try it there.

@kannanseeni
Copy link

It is not working. Getting error
undefined is not an object (evaluating '_reactNativeAudioStreamer2.default.setUrl')

@shikhawebvillee
Copy link

@kannanseeni having a same problem, did you find any solution for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants