micro-react-audio-player
v1.2.4
Published
Very small html5 audio player for React
Downloads
4
Readme
Micro Audio Player for React
Usage
npm i micro-react-audio-player -S
import Player from 'micro-react-audio-player';
const MyCustomComponent = React.createClass({
render() {
const source = 'http://www.w3schools.com/html/horse.ogg';
const sourceType = 'audio/ogg';
const play = <span>Play</span>; // optional
const pause = <span>Pause</span>; // optional
const shouldAutoplay = true; // optional
return <Player source={source} sourceType="audio/ogg"
playElement={play} pauseElement={pause}
autoPlay={shouldAutoplay} />;
}
});