Giter Club home page Giter Club logo

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.
  • Support cameraOptions and recordAsyncOptions from react-native-camera

Installation

yarn add react-native-beautiful-video-recorder react-native-camera react-native-vector-icons

Follow react-native-camera & react-native-vector-icons for linking native libraries.

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.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<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 = () => {
	// 30 seconds
	this.videoRecorder.open({ maxLength: 30 },(data) => {
		console.log('captured data', data);
	});
}

render() {
	return (
		<View>
			......
		  <TouchableOpacity onPress={this.start}>
		  	<Text>Start</Text>
		  </TouchableOpacity>
		  <VideoRecorder ref={(ref) => { this.videoRecorder = ref; }} />
		</View>
	);
}

Properties

param Info
cameraOptions https://github.com/react-native-community/react-native-camera/blob/master/docs/RNCamera.md
recordOptions https://github.com/react-native-community/react-native-camera/blob/master/docs/RNCamera.md

Callback Data

The calback will be fulfilled with an object with some of the following properties:

  • uri: (string) the path to the video saved on your app's cache directory.

  • videoOrientation: (number) orientation of the video

  • deviceOrientation: (number) orientation of the device

  • iOS codec: the codec of the recorded video. One of RNCamera.Constants.VideoCodec

  • isRecordingInterrupted: (boolean) whether the app has been minimized while recording

Todo

  • Support playback before saving.
  • Switch camera.

License

MIT

Contact

[email protected]

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

Contributors

cawfree avatar danielmschmidt avatar paramaggarwal avatar phuochau avatar webjunkie01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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

get video file

Greetings good afternoon, I would like to know how I can get the video recorded correctly since it only gives me a path with a uri, and I would like to have access to the video that it records as a file not as a uri

Modal is used without SafeAreaView

As Modal code inside index.js of this library having no SafeAreaView or specific marginTop and marginBottom so having issue in iOS devices having notch or pill button,
Which causes the application has to force stop using swipe up because close button is not pressable and timer is hidden under notch.
Please check below screenshot.

image

Occasional Crashes on Video Stop

Occasionally, the app will restart upon stopping a video recording.

Apologies for the super short bug report, I'll follow up with a full debug log ASAP.

Not working and i want to create a video recorder in react native and i got this error

The development server returned response error code: 500

URL: http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false

Body:
{"message":"TransformError: /media/znt/Office/Ekta_Tekpreneur/React_native/VideoRecoder/node_modules/moment/moment.js: require() must have a single string literal argument","type":"TransformError","lineNumber":0,"description":"","errors":[{"description":"","lineNumber":0}]}
processBundleResult
BundleDownloader.java:170
access$100
BundleDownloader.java:39
onResponse
BundleDownloader.java:139
execute
RealCall.java:135
run
NamedRunnable.java:32
runWorker
ThreadPoolExecutor.java:1162
run
ThreadPoolExecutor.java:636
run
Thread.java:764

Publish new version

Hey there,

Thank you for this awesome library. Unfortunately, it doesn't work with the newest React Native, at least the version published on npm. Could you update it to reflect the recent changes that allow compatibility with prop-types (they were removed from React)

CameraManager.checkIfRecordAudioPermissionsAreDefined

Hi!
I would like to use this beautiful-video-recorder in my project.
But I get the error CameraManager.checkIfRecordAudioPermissionsAreDefined
I tried reinstalling react-native-camera but it didn't help.
Ask for help in solving the problem.

Thank you for answer.

Full log:

[Unhandled promise rejection: TypeError: CameraManager.checkIfRecordAudioPermissionsAreDefined is not a function. (In 'CameraManager.checkIfRecordAudioPermissionsAreDefined()', 'CameraManager.checkIfRecordAudioPermissionsAreDefined' is undefined)]
- node_modules\react-native-camera\src\RNCamera.js:27:27 in requestPermissions
- node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
- node_modules\regenerator-runtime\runtime.js:293:29 in invoke
- node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
- node_modules\regenerator-runtime\runtime.js:154:27 in invoke
- node_modules\regenerator-runtime\runtime.js:164:18 in PromiseImpl.resolve.then$argument_0
- node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
- node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

streaming

hi

how can I stream this 'data' to socket io server?

After unlink & uninstall there are still references to -lRNMov2mp4

I tried to remove this package by doing the following

react-native unlink react-native-beautiful-video-recorder
npm uninstall --save react-native-beautiful-video-recorder

When I attempt to do a release build of my RN project now I'm getting

ld: library not found for -lRNMov2mp4
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Seems it's not cleaning up everything.
I've tried doing a Project Clean in xcode.

undefined is not an object

An error occured "undefined is not an object(evaluating '_react2.PropTypes.bool)"

image

"react-native-beautiful-video-recorder": "^1.2.0",

Environment:
OS: macOS High Sierra 10.13.6
Node: 8.11.3
Yarn: 1.9.4
npm: 6.3.0
Watchman: 4.9.0
Xcode: Xcode 10.1 Build version 10B61
Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

Front Camera

Hi,

This is JSX my code

  render() {
    return (
      <View>

            <TouchableOpacity onPress={this.startVideo}>
            	<Text>Start</Text>
            </TouchableOpacity>
            <VideoRecorder ref={(ref) => { this.videoRecorder = ref; }} />
          </View>
    );
  }

In my JSX is being hidden in the video recorder. I have attached the screenshot below. its happen only the simmular but in real device working fine. Also I can't able to record using front camera how can I change back to front camera. Kindly give me the needful suggestion.

Screenshot_1584968816

Thanks...

Plugin issue

After running the the following

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

The plugin was not installed properly there were some warnings due which elements are missing. After there was another command for linking the module I guess "react-native link" it worked fine. But after that when I tried to run my code after adding this line as asked

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

It throughs an error I am attaching of my simulator for the same. If needed I can also put the errors that I got while installing the plugin.

Thanks in Advance.

simulator screen shot 04-aug-2017 5 35 00 pm

Camera not showing

I am using the camera like so:

<View>
<VideoRecorder/>
</View>

But the video recorder isn't showing. How to fix this error?

"npm i --save react-native-beautiful-video-recorder" shows errors

Hi Hau,

Thanks for making this video recorder, I have issue installing it, could you please help?

[Repro steps]
react-native init videoCapture
cd videoCapture
npm i --save react-native-beautiful-video-recorder

[Expect]
Install ok

[Actual]
[email protected] C:\Users\turbo_000\Desktop\video\videoCapture
+-- UNMET PEER DEPENDENCY [email protected]
+-- [email protected]
+-- UNMET PEER DEPENDENCY react-native-camera@git+https://github.com/lwansbrough/react-native-camera.git
+-- UNMET PEER DEPENDENCY react-native-compress@^1.0.2
+-- UNMET PEER DEPENDENCY react-native-spinkit@^1.0.2
`-- UNMET PEER DEPENDENCY react-native-vector-icons@^4.0.0

npm WARN [email protected] requires a peer of react-native@^0.43.3 but none was installed.
npm WARN [email protected] requires a peer of react-native-camera@git+https://github.com/lwansbrough/react-native-camera.git but none was installed.
npm WARN [email protected] requires a peer of react-native-vector-icons@^4.0.0 but none was installed.
npm WARN [email protected] requires a peer of react-native-spinkit@^1.0.2 but none was installed.
npm WARN [email protected] requires a peer of react-native-compress@^1.0.2 but none was installed.

npm i react-native-beautiful-video-recorder install err

ERESOLVE unable to resolve dependency tree
! peer react@"16.9.0" from [email protected]
npm ERR! node_modules/react-native-beautiful-video-recorder
npm ERR! react-native-beautiful-video-recorder@"*" from the root project
Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
how to Resolved it?

Video Storage

Hi,

Video recorder working fine also I am getting that video and played in my app. But I can't able to see that video in my gallery. Kindly give me any suggestions.

install时输入命令react-native link包下面的错

internal/modules/cjs/loader.js:605
throw err;
^

Error: Cannot find module 'asap/raw'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/Users/wangfeng/Dev/code/ws_rn/testDemo/node_modules/promise/lib/core.js:3:12)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Module._compile (/Users/wangfeng/Dev/code/ws_rn/testDemo/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Object.newLoader [as .js] (/Users/wangfeng/Dev/code/ws_rn/testDemo/node_modules/pirates/lib/index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:620:32)

Failed to load budle

when i try to use video recorder i am getting following error . could not able to figure out. what is the issues on the node module. i try npm install many times. i get this error always .

image

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.