Skip to content

respoke/micro-react-audio-player

Repository files navigation

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

About

A micro audio player component for React

Resources

License

Stars

Watchers

Forks

Packages

No packages published