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

farskid/react-audio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-audio

Declerative Audio component for React

Installation

simply run npm install react-audio --save or clone the repository git clone https://github.com/farskid/react-audio.git.

Usage

import Audio into your component and use it.

  import React, {Component} from 'react'
  import Audio from 'react-audio'
  
  export default class MyComponent extends Component {
    render() {
      return (
        <Audio source="example/audio/path" loop={true} />
      )
    }
  }

Usefull props

The only required prop is source. There are also other helper props:

  • loop ==> Boolean ==> indicates whether the audio should be played infinite loop or not (It will pause during pause condition)
  • pause ==> statement which when gets true the audio will pause and will resume or play when it changes to false.

About

Audio component for react

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published