MediaRecorder API using React hooks.
npm install --save use-media-recorder
- Supports both video audio and audio only recordings.
- Currently it generates
video/webm
andaudio/webm
.
import { useMediaRecorder } from 'use-media-recorder'
const [isRecording, setIsRecording] = useState(false)
const [setCaptureRef, data, err] = useMediaRecorder({ isRecording })
import { useMediaRecorder } from 'use-media-recorder'
const [isRecording, setIsRecording] = useState(false)
const [setCaptureRef, data, err] = useMediaRecorder({ isRecording, audioOnly: true })
Full example can be found here
git clone [email protected]:jagonzalr/useMediaRecorder.git
cd useMediaRecorder
npm intall
npm start
useMediaRecorder is MIT licensed.