# react-native-record-screen

> react-native-record-screen

Latest version **0.6.2** (published 2024-04-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-record-screen
pnpm add react-native-record-screen
yarn add react-native-record-screen
bun add react-native-record-screen
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.2 |
| Published | 2024-04-18 |
| First published | 2020-07-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 16.0.0 |
| Dependencies | 0 |
| Unpacked size | 67.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 164 |
| Author | Yuta Suzuki |
| Maintainers | yutasuzuki |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-record-screen
- Repository: https://github.com/yutasuzuki/react-native-record-screen
- Homepage: https://github.com/yutasuzuki/react-native-record-screen#readme
- Issues: https://github.com/yutasuzuki/react-native-record-screen/issues
- npm.io page: https://npm.io/package/react-native-record-screen

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.6.2 (latest) — 2024-04-18
- 0.6.1 — 2023-08-02
- 0.6.0 — 2023-06-29
- 0.5.1 — 2023-05-01
- 0.5.0 — 2023-02-08
- 0.4.0 — 2022-01-27
- 0.3.2 — 2020-10-19
- 0.3.1 — 2020-10-08
- 0.3.0 — 2020-09-24
- 0.2.1 — 2020-09-09
- 0.2.0 — 2020-09-08
- 0.1.5 — 2020-08-25
- 0.1.2 — 2020-08-11
- 0.1.1 — 2020-08-11
- 0.1.0 — 2020-07-29

## README

[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua)

# react-native-record-screen

A screen record module for React Native.

- Support iOS >= 11.0 (Simulator is not work)

- Support Android
  - minSdkVersion = 26
  - compileSdkVersion = 34
  - targetSdkVersion = 34
  - use [HBRecorder](https://github.com/HBiSoft/HBRecorder)

## Installation

```sh
npm install react-native-record-screen
```

### iOS

1. Add the permission strings to your Info.plist

```xml
<key>NSCameraUsageDescription</key>
<string>Please allow use of camera</string>
<!-- If you intend to use the microphone -->
<key>NSMicrophoneUsageDescription</key>
<string>Please allow use of microphone</string>
```

2. pod install

```sh
npx pod-install
```

3. Add ReplayKit.framework at Link Binary With Libraries

![Add ReplayKit.framework at Link Binary With Libraries](https://user-images.githubusercontent.com/4530616/257236753-e3555d2f-53a5-4ffd-87eb-db1691d0552d.png)

### Android

1. Add the permissions to your AndroidManifest.xml

```xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- If you intend to use the microphone -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
```

## Usage

### Recording full screen

```js
import RecordScreen, { RecordingResult } from 'react-native-record-screen';

// recording start
const res = RecordScreen.startRecording().catch((error) => console.error(error));
if (res === RecordingResult.PermissionError) {
  // user denies access
}

// recording stop
const res = await RecordScreen.stopRecording().catch((error) =>
  console.warn(error)
);
if (res) {
  const url = res.result.outputURL;
}
```

### Setting microphone

default true.

```js
// mic off
RecordScreen.startRecording({ mic: false }).catch((error) =>
  console.error(error)
);

// recording stop
const res = await RecordScreen.stopRecording().catch((error) =>
  console.warn(error)
);
if (res) {
  const url = res.result.outputURL;
}
```

### Adjusting bitrate / frame rate

```js
RecordScreen.startRecording({
  bitrate: 1024000, // default 236390400
  fps: 24, // default 60
})
```

### Clean Sandbox

```js
RecordScreen.clean();
```

## License

MIT

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