GithubHelp home page GithubHelp logo

eliaslecomte / react-native-record-screen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yutasuzuki/react-native-record-screen

0.0 0.0 0.0 1.26 MB

react-native-record-screen

License: MIT License

JavaScript 3.88% Ruby 8.21% C 0.21% Objective-C 6.78% Java 14.82% Kotlin 14.10% TypeScript 20.00% Objective-C++ 31.88% Swift 0.13%

react-native-record-screen's Introduction

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 = 33
    • targetSdkVersion = 31
    • 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.WRITE_INTERNAL_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, { RecordingStartResponse } from 'react-native-record-screen';

// recording start
const res = RecordScreen.startRecording().catch((error) => console.error(error));
if (res === RecordingStartResponse.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

react-native-record-screen's People

Contributors

yutasuzuki avatar robrechtme avatar 345ml avatar seachaos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.