use-media-recorder
v2.0.4
Published
MediaRecorder API using React hooks.
Downloads
1,508
Maintainers
Readme
useMediaRecorder
MediaRecorder API using React hooks.
Table of Contents
Getting started
npm install --save use-media-recorder
- Supports both video + audio and audio only recordings.
- Currently it generates
video/webm
andaudio/webm
.
Usage
Video and audio
import { useMediaRecorder } from 'use-media-recorder'
const [isRecording, setIsRecording] = useState(false)
const [setCaptureRef, data, err] = useMediaRecorder({ isRecording })
Audio only
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
Demo
git clone [email protected]:jagonzalr/useMediaRecorder.git
cd useMediaRecorder
npm intall
npm start
License
useMediaRecorder is MIT licensed.