Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 704 Bytes

README.md

File metadata and controls

26 lines (21 loc) · 704 Bytes

Micro Audio Player for React

minimal html5 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} />;
    }
});