Giter Site home page Giter Site logo

linecode / react-native-beautiful-video-recorder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phuochau/react-native-beautiful-video-recorder

0.0 2.0 0.0 2.41 MB

The video recorder component that extends from react-native-camera. It works for both iOS & Android.

Home Page: https://github.com/phuochau/

Objective-C 15.57% Ruby 3.39% JavaScript 81.04%

react-native-beautiful-video-recorder's Introduction

react-native-beautiful-video-recorder

The video recorder component that extends from react-native-camera. It works for both iOS & Android.

Sample

Features:

  • Record video on iOS and Android.
  • Convert MOV to MP4 on iOS. So both Android & iOS will return MP4 format.

Installation

npm i --save react-native-beautiful-video-recorder
react-native link

Please file an issue if you have any trouble!

Configuration

iOS

With iOS 10 and higher you need to add the "Privacy - Camera Usage Description" key to the info.plist of your project. This should be found in 'your_project/ios/your_project/Info.plist'. Add the following code:

<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>

<!-- Include this only if you are planning to use the microphone for video recording -->
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microsphone is accessed for the first time</string>

Android

Add permissions in your Android Manifest (required for video recording feature)

<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Usage

import VideoRecorder from 'react-native-beautiful-video-recorder';
....

start = () => {
	this.videoRecorder.open((data) => {
		console.log('captured data', data);
	});
}

render() {
	return (
		<View>
			......
		  <TouchableOpacity onPress={this.start}>
		  	<Text>Start</Text>
		  </TouchableOpacity>
		  <VideoRecorder ref={(ref) => { this.videoRecorder = ref; }} compressQuality={'medium'} /> // quality will be 'low', 'medium' or 'high'
		</View>
	);
}

Callback Data

param Info
path Returns the path of the captured image or video file on disk
width (currently iOS video only) returns the video file's frame width
height (currently iOS video only) returns the video file's frame height
duration (currently iOS video only) video file duration
size (currently iOS video only) video file size (in bytes)

Todo

  • Support playback before saving.
  • Switch camera.

License

MIT

Contact

[email protected]

react-native-beautiful-video-recorder's People

Contributors

phuochau avatar

Watchers

 avatar  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.