React Simple Audio Player
A React component with graphics for playing audio files
Usage
npm install react-simple-audio-player --save
{ return <PlayAudio url='http://www.noiseaddicts.com/samples_1w72b820/4186.mp3' /> };
The component uses react-player
package to play media and add simple design and controls to extend the package.
Props
Prop | Description | Default |
---|---|---|
url |
The url of an audio to play | |
width |
Set the width and height (height is equal to width) of the player | 60px |
simpleMode |
Set to true disable seconds counter, automatically true with width less then 45px |
false |
colorScale |
Pass array of 5 colors for theme personalisation | scaled red shades (see demo) |
Changing color theme example
const colorScale = chroma { return <PlayAudio url='http://www.noiseaddicts.com/samples_1w72b820/4186.mp3' colorScale=colorScale /> }
Result: