Skip to content

Commit

Permalink
Updated libraries to work with latest react-native, react-native-came…
Browse files Browse the repository at this point in the history
…ra & react-native-vector-icons. Removed react-native-compress & react-native-spinkit because right now we can set video codec via react-native-camera options
  • Loading branch information
phuochau committed Dec 2, 2019
1 parent 69ec889 commit 8408dc5
Show file tree
Hide file tree
Showing 41 changed files with 152 additions and 923 deletions.
2 changes: 1 addition & 1 deletion Example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const App: () => React$Node = () => {
const videoRecorder = useRef(null)
function startRecorder () {
if (videoRecorder && videoRecorder.current) {
videoRecorder.current.open((data) => {
videoRecorder.current.open({ maxLength: 30 }, (data) => {
console.log('captured data', data);
})
}
Expand Down
2 changes: 2 additions & 0 deletions Example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ android {
}

dependencies {
implementation project(':react-native-camera')
implementation project(':react-native-vector-icons')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import org.reactnative.camera.RNCameraPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.hauvo.compress.RNCompressPackage;
import com.react.rnspinkit.RNSpinkitPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
Expand Down
4 changes: 4 additions & 0 deletions Example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
rootProject.name = 'Example'
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
149 changes: 82 additions & 67 deletions Example/ios/Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions Example/ios/Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<string/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
Expand Down Expand Up @@ -70,19 +70,14 @@
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
<string>Fontisto.ttf</string>
</array>
<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>

<!-- Required with iOS 11 and higher: include this only if you are planning to use the camera roll -->
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Your message to user when the photo library is accessed for the first time</string>

<!-- Include this only if you are planning to use the camera roll -->
<key>NSPhotoLibraryUsageDescription</key>
<string>Your message to user when the photo library 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 microphone is accessed for the first time</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion Example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ target 'Example' do
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'RNMov2mp4', :path => '../node_modules/react-native-beautiful-video-recorder/ios'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

target 'ExampleTests' do
inherit! :search_paths
Expand Down
24 changes: 12 additions & 12 deletions Example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ PODS:
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsinspector (0.61.5)
- react-native-camera (3.13.0):
- react-native-camera (3.13.1):
- React
- react-native-camera/RCT (= 3.13.0)
- react-native-camera/RN (= 3.13.0)
- react-native-camera/RCT (3.13.0):
- react-native-camera/RCT (= 3.13.1)
- react-native-camera/RN (= 3.13.1)
- react-native-camera/RCT (3.13.1):
- React
- react-native-camera/RN (3.13.0):
- react-native-camera/RN (3.13.1):
- React
- React-RCTActionSheet (0.61.5):
- React-Core/RCTActionSheetHeaders (= 0.61.5)
Expand Down Expand Up @@ -225,7 +225,7 @@ PODS:
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- ReactCommon/jscallinvoker (= 0.61.5)
- RNMov2mp4 (1.0.0):
- RNVectorIcons (6.6.0):
- React
- Yoga (1.14.0)

Expand Down Expand Up @@ -258,7 +258,7 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- RNMov2mp4 (from `../node_modules/react-native-beautiful-video-recorder/ios`)
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
Expand Down Expand Up @@ -316,8 +316,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/Libraries/Vibration"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
RNMov2mp4:
:path: "../node_modules/react-native-beautiful-video-recorder/ios"
RNVectorIcons:
:path: "../node_modules/react-native-vector-icons"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"

Expand All @@ -337,7 +337,7 @@ SPEC CHECKSUMS:
React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
react-native-camera: 05b9bf888b87885b60ef4f56f8027b41b739b40b
react-native-camera: 1df7f9a047591bbc2c9a7ec80bd6412d3c19579f
React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76
React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360
React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72
Expand All @@ -348,9 +348,9 @@ SPEC CHECKSUMS:
React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe
React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
RNMov2mp4: 6a6c99208945d315a9c811c02e4e17d83c638eb7
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b

PODFILE CHECKSUM: ffefae56b29e9ef1b481b2b621b5baf42d2f2671
PODFILE CHECKSUM: be6fc1aa9dad6f19602fe27b03ca07e1fbbb97c8

COCOAPODS: 1.8.3
4 changes: 3 additions & 1 deletion Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-beautiful-video-recorder": "file:../"
"react-native-beautiful-video-recorder": "file:../",
"react-native-camera": "^3.13.1",
"react-native-vector-icons": "^6.6.0"
},
"devDependencies": {
"@babel/core": "^7.7.4",
Expand Down
39 changes: 7 additions & 32 deletions Example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5162,7 +5162,7 @@ prompts@^2.0.1:
kleur "^3.0.3"
sisteransi "^1.0.3"

prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2:
prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
Expand Down Expand Up @@ -5232,44 +5232,19 @@ react-is@^16.8.1, react-is@^16.8.4, react-is@^16.9.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==

"react-native-beautiful-video-recorder@file:..":
version "1.2.0"
dependencies:
moment "2.24.0"
react-native-camera "3.13.0"
react-native-compress "1.0.2"
react-native-spinkit "1.5.0"
react-native-vector-icons "6.6.0"

"react-native-beautiful-video-recorder@file:../":
version "1.2.0"
version "2.0.0"
dependencies:
moment "2.24.0"
react-native-camera "3.13.0"
react-native-compress "1.0.2"
react-native-spinkit "1.5.0"
react-native-vector-icons "6.6.0"

[email protected].0:
version "3.13.0"
resolved "https://registry.yarnpkg.com/react-native-camera/-/react-native-camera-3.13.0.tgz#999741e3b5e56426ee678055d0bc4e57e90631cc"
integrity sha512-iMB8ODN1abcuUiWy62+YD2ae/p/ADMOGcFi+41KV7FpNKjbIM8fYbIx2oLyljTxXvBPL5pMovqW2aw5DEwf3IQ==
react-native-camera@^3.13.1:
version "3.13.1"
resolved "https://registry.yarnpkg.com/react-native-camera/-/react-native-camera-3.13.1.tgz#016a011ca264d7044e2f1ad11fc624b90020aeb9"
integrity sha512-HXCo75sFYOJRqtbiG12ttoG6K4UdS1mfOwu6NoQmxj6IV2KrNgdOYO4YTyLymGUXNs3LyOWpJskVvCRupoFA3A==
dependencies:
prop-types "^15.6.2"

[email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/react-native-compress/-/react-native-compress-1.0.2.tgz#202fdf71d6ca3938c4c3a0a54158eb68d4debf6b"
integrity sha1-IC/fcdbKOTjEw6ClQVjraNTev2s=

[email protected]:
version "1.5.0"
resolved "https://registry.yarnpkg.com/react-native-spinkit/-/react-native-spinkit-1.5.0.tgz#598b4b138b1e95cc232dfb2fc7e64dcdd45de574"
integrity sha512-HHOIH3Lq+oFsmhPBO9Y2hcxkKNm955gmNBaFgNUrshhGU4Dqp8qWj3bbVrwjBJOC5W+cvHSqyTsfgmpMPoUoTA==
dependencies:
prop-types "^15.5.8"

[email protected]:
react-native-vector-icons@^6.6.0:
version "6.6.0"
resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-6.6.0.tgz#66cf004918eb05d90778d64bd42077c1800d481b"
integrity sha512-MImKVx8JEvVVBnaShMr7/yTX4Y062JZMupht1T+IEgbqBj4aQeQ1z2SH4VHWKNtWtppk4kz9gYyUiMWqx6tNSw==
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ The video recorder component that extends from `react-native-camera`. It works f

## Features:
- Record video on iOS and Android.
- Convert MOV to MP4 on iOS. So both Android & iOS will return MP4 format.
- Support `cameraOptions` and `recordAsyncOptions` from `react-native-camera`

## Installation

```bash
npm i --save react-native-beautiful-video-recorder
react-native link
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
Expand Down Expand Up @@ -47,7 +48,8 @@ import VideoRecorder from 'react-native-beautiful-video-recorder';
....

start = () => {
this.videoRecorder.open((data) => {
// 30 seconds
this.videoRecorder.open({ maxLength: 30 },(data) => {
console.log('captured data', data);
});
}
Expand All @@ -59,11 +61,19 @@ render() {
<TouchableOpacity onPress={this.start}>
<Text>Start</Text>
</TouchableOpacity>
<VideoRecorder ref={(ref) => { this.videoRecorder = ref; }} compressQuality={'medium'} /> // quality will be 'low', 'medium' or 'high'
<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

param | Info
Expand Down
11 changes: 0 additions & 11 deletions ios/RNMov2mp4.h

This file was deleted.

64 changes: 0 additions & 64 deletions ios/RNMov2mp4.m

This file was deleted.

24 changes: 0 additions & 24 deletions ios/RNMov2mp4.podspec

This file was deleted.

Loading

0 comments on commit 8408dc5

Please sign in to comment.