use-simple-audio
v1.1.0
Published
The simplest React hook to play SE.
Downloads
3
Readme
use-simple-audio
Install
npm install --save use-simple-audio
Usage
import * as React from 'react';
import useSimpleAudio from 'use-simple-audio';
const App = () => {
const { play, pause, stop } = useSimpleAudio('/sample.mp3', true);
return (
<div>
<button onClick={play}>PLAY</button>
<button onClick={pause}>PAUSE</button>
<button onClick={stop}>STOP</button>
</div>
);
};
License
MIT © ossan-engineer
This hook is created using create-react-hook.