tomasztest

1.1.8 • Public • Published

react-native-background-audio

A react component for playing audio in the back of your project.

npm install react-native-background-audio --save
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import BgAudio from 'react-native-background-audio'

export default class App extends React.Component {
  render() {
    return (
      <BgAudio options={audio_options}></BgAudio>
    );
  }
}
const audio_options = {
  source:{local: require('./music/sample.mp3')}  //ex. require('./music/sample.mp3')
}

For Local audio source pass in Local object:

const audio_options = {
  source:{local: require('./music/sample.mp3')}  //ex. require('./music/sample.mp3')
}

For Remote audio uri pass in Remote object:

const audio_options = {
  source:{remote:{uri:"http://www.sample-videos.com/audio/mp3/india-national-anthem.mp3"}}
}

Readme

Keywords

Package Sidebar

Install

npm i tomasztest

Weekly Downloads

2

Version

1.1.8

License

MIT

Last publish

Collaborators

  • ttomaszito