0.6.2 • Published 21 days ago

react-native-record-screen v0.6.2

Weekly downloads
34
License
MIT
Repository
github
Last release
21 days ago

Stand With Ukraine

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

Installation

npm install react-native-record-screen

iOS

  1. Add the permission strings to your Info.plist
<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>
  1. pod install
npx pod-install
  1. Add ReplayKit.framework at Link Binary With Libraries

Add ReplayKit.framework at Link Binary With Libraries

Android

  1. Add the permissions to your AndroidManifest.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

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.

// 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

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

Clean Sandbox

RecordScreen.clean();

License

MIT

0.6.2

21 days ago

0.6.1

9 months ago

0.6.0

10 months ago

0.5.0

1 year ago

0.5.1

1 year ago

0.4.0

2 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago