# react-video-recorder

> ## Installation

Latest version **3.19.4** (published 2022-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-video-recorder
pnpm add react-video-recorder
yarn add react-video-recorder
bun add react-video-recorder
```

## Health

**Score 38/100 (D)** — status: abandoned.

Positive: has types package; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.19.4 |
| Published | 2022-10-14 |
| First published | 2018-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/react-video-recorder) |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 86.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 195 |
| Maintainers | xicombd |

## Links

- npm: https://www.npmjs.com/package/react-video-recorder
- Repository: https://github.com/fbaiodias/react-video-recorder
- Homepage: https://github.com/fbaiodias/react-video-recorder#readme
- Issues: https://github.com/fbaiodias/react-video-recorder/issues
- npm.io page: https://npm.io/package/react-video-recorder

## Dependencies (3)

- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.5.0
- [react-svg-inline](https://npm.io/package/react-svg-inline.md) ^2.1.0
- [fix-webm-duration](https://npm.io/package/fix-webm-duration.md) ^1.0.4

## Recent versions

- 3.19.4 (latest) — 2022-10-14
- 3.19.3 — 2022-04-29
- 3.19.2 — 2022-04-10
- 3.19.1 — 2021-08-10
- 3.19.0 — 2021-08-10
- 3.18.4 — 2021-07-18
- 3.18.2 — 2021-06-11
- 3.18.1 — 2021-06-09
- 3.18.0 — 2021-05-03
- 3.17.3 — 2021-05-03
- 3.17.2 — 2021-01-09
- 3.17.1 — 2020-05-03
- 3.17.0 — 2020-02-10
- 3.16.1 — 2020-01-12
- 3.16.0 — 2020-01-08
- … 55 more at https://npm.io/package/react-video-recorder/versions

## README

# react-video-recorder

## Installation

```sh
yarn add react-video-recorder

# Note: this project has react, react-dom, prop-types & styled-components as peerDependencies,
#       so if you're starting from scratch run this instead:
yarn add react-video-recorder react react-dom prop-types styled-components
```

## Usage

Basic usage [(edit in stakblitz)](https://stackblitz.com/edit/react-video-recorder-demo):

```js
import React from 'react'
import { render } from 'react-dom'
import VideoRecorder from 'react-video-recorder'

const App = () => (
  <VideoRecorder
    onRecordingComplete={(videoBlob) => {
      // Do something with the video...
      console.log('videoBlob', videoBlob)
    }}
  />
)

render(<App />, document.getElementById('root'))
```

Also check the [Storybook](https://react-video-recorder.vercel.app/) for more demos and usage examples.

**Note:** if you click the **"Show info"** button in the top-right corner, you should be able to see a table with the supported prop-types.

### Modifying the UI

All the UI can be customized by passing the following props:

#### `renderDisconnectedView`

View that's rendered before the user enables the camera access.

**Default value:** `() => <DisconnectedView />`

[See `<DisconnectedView />` source here.](src/defaults/disconnected-view.js)

#### `renderLoadingView`

View that's rendered while the camera is initializing.

`() => <LoadingView />`

[See `<LoadingView />` source here.](src/defaults/loading-view.js)

#### `renderVideoInputView`

View that's rendered when the browser does not support inline recording but allows opening the native camera (mainly iOS).

**Default value:** `({ videoInput }) => <Fragment>{videoInput}</Fragment/>`

#### `renderUnsupportedView`

View that's rendered when the browser does not support recording video.

**Default value:** `() => <UnsupportedView />`

[See `<UnsupportedView />` source here.](src/defaults/unsupported-view.js)

#### `renderErrorView`

View that's rendered an unexpected error occurs.

**Default value:** `() => <ErrorView />`

[See `<ErrorView />` source here.](src/defaults/error-view.js)

#### `renderActions`

Overlay that's rendered on top of the views and that contains the elements like the buttons, the timer or the countdown.

[See the default implementation here.](src/defaults/render-actions.js)

## Development

Requirements

`node version ">=8.3"`

Install packages

```sh
yarn install
```

Run the storybook demo

```sh
yarn start
```

### Committing

To commit run yarn start then commit. We use Husky to verify before committing.

---
_Source: https://npm.io/package/react-video-recorder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
