phuochau/react-native-beautiful-video-recorder
소개
The video recorder component that extends from react-native-camera. It works for both iOS & Android.
웹 및 앱 개발What you can do
- Record video on iOS and Android.
- Support cameraOptions and recordAsyncOptions from react-native-camera
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalreact-native-beautiful-video-recorder
The video recorder component that extends from react-native-camera. It works for both iOS & Android.
Features:
- Record video on iOS and Android.
- Support
cameraOptionsandrecordAsyncOptionsfromreact-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
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 videodeviceOrientation: (number) orientation of the deviceiOScodec: the codec of the recorded video. One ofRNCamera.Constants.VideoCodecisRecordingInterrupted: (boolean) whether the app has been minimized while recording
Todo
- Support playback before saving.
- Switch camera.
License
MIT
Contact
관련 프로젝트 살펴보기
불러오는 중…