Size
0.49 kb
useMediaRecorder
Record media streams.
Installation
Usage
The recording automatically starts when a media stream is provided and stops when the stream is nullish.
You can pause and resume the recording:
Transform the recorded data into a File:
Example
Record video from the device's camera:
API Reference
UseMediaRecorderOptions
The options of the useMediaRecorder hook. See MDN docs for more details.
Prop | Type | Default |
---|---|---|
onComplete? | ((chunks: Blob[]) => void) | - |
onResume? | (() => void) | - |
onPause? | (() => void) | - |
onStart? | (() => void) | - |
onStop? | (() => void) | - |
timeslice? | number | - |
videoBitsPerSecond? | number | - |
mimeType? | string | - |
bitsPerSecond? | number | - |
audioBitsPerSecond? | number | - |
UseMediaRecorderReturn
The return value of the useMediaRecorder hook.
Prop | Type | Default |
---|---|---|
resume | () => void | - |
pause | () => void | - |
state | RecordingState | - |