Skip to content

Commit ccd8705

Browse files
committed
Initialize project
1 parent fd89f40 commit ccd8705

19 files changed

+6206
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-native-stage-0", "react-native"]
3+
}

.eslintrc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
4+
"env": {
5+
"browser": false,
6+
"node": true,
7+
"mocha": true,
8+
"es6": true
9+
},
10+
"globals": {
11+
"window": true,
12+
"navigator": true
13+
},
14+
"plugins": [
15+
"react",
16+
"react-native"
17+
],
18+
"rules": {
19+
"indent": [2, "tab", {"SwitchCase": 1}],
20+
"comma-dangle": 0,
21+
"no-console": 1,
22+
"react-native/no-unused-styles": 2,
23+
"no-return-assign": 0,
24+
"react/jsx-boolean-value": 0,
25+
"react/jsx-indent-props": [2, "tab"],
26+
"no-use-before-define": 0
27+
}
28+
}

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js:
3+
- "6"
4+
script:
5+
npm test

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
# react-native-video-editor
3+
4+
## Getting started
5+
6+
`$ npm install react-native-video-editor --save`
7+
8+
### Mostly automatic installation
9+
10+
`$ react-native link react-native-video-editor`
11+
12+
### Manual installation
13+
14+
15+
#### iOS
16+
17+
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
18+
2. Go to `node_modules``react-native-video-editor` and add `RNVideoEditor.xcodeproj`
19+
3. In XCode, in the project navigator, select your project. Add `libRNVideoEditor.a` to your project's `Build Phases``Link Binary With Libraries`
20+
4. Run your project (`Cmd+R`)<
21+
22+
#### Android
23+
24+
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
25+
- Add `import com.shahenlibrary.RNVideoEditorPackage;` to the imports at the top of the file
26+
- Add `new RNVideoEditorPackage()` to the list returned by the `getPackages()` method
27+
2. Append the following lines to `android/settings.gradle`:
28+
```
29+
include ':react-native-video-editor'
30+
project(':react-native-video-editor').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video-editor/android')
31+
```
32+
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
33+
```
34+
compile project(':react-native-video-editor')
35+
```
36+
37+
38+
## Usage
39+
```javascript
40+
import RNVideoEditor from 'react-native-video-editor';
41+
42+
// TODO: What do with the module?
43+
RNVideoEditor;
44+
```
45+

android/build.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
apply plugin: 'com.android.library'
3+
4+
android {
5+
compileSdkVersion 23
6+
buildToolsVersion "23.0.1"
7+
8+
defaultConfig {
9+
minSdkVersion 16
10+
targetSdkVersion 22
11+
versionCode 1
12+
versionName "1.0"
13+
ndk {
14+
abiFilters "armeabi-v7a", "x86"
15+
}
16+
}
17+
lintOptions {
18+
warning 'InvalidPackage'
19+
}
20+
}
21+
22+
dependencies {
23+
compile 'com.facebook.react:react-native:0.20.+'
24+
}
25+

android/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.shahenlibrary">
4+
5+
</manifest>
6+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
package com.shahenlibrary;
3+
4+
import com.facebook.react.bridge.ReactApplicationContext;
5+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
6+
import com.facebook.react.bridge.ReactMethod;
7+
import com.facebook.react.bridge.Callback;
8+
9+
public class RNVideoEditorModule extends ReactContextBaseJavaModule {
10+
11+
private final ReactApplicationContext reactContext;
12+
13+
public RNVideoEditorModule(ReactApplicationContext reactContext) {
14+
super(reactContext);
15+
this.reactContext = reactContext;
16+
}
17+
18+
@Override
19+
public String getName() {
20+
return "RNVideoEditor";
21+
}
22+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
package com.shahenlibrary;
3+
4+
import java.util.Arrays;
5+
import java.util.Collections;
6+
import java.util.List;
7+
8+
import com.facebook.react.ReactPackage;
9+
import com.facebook.react.bridge.NativeModule;
10+
import com.facebook.react.bridge.ReactApplicationContext;
11+
import com.facebook.react.uimanager.ViewManager;
12+
import com.facebook.react.bridge.JavaScriptModule;
13+
public class RNVideoEditorPackage implements ReactPackage {
14+
@Override
15+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
16+
return Arrays.<NativeModule>asList(new RNVideoEditorModule(reactContext));
17+
}
18+
19+
@Override
20+
public List<Class<? extends JavaScriptModule>> createJSModules() {
21+
return Collections.emptyList();
22+
}
23+
24+
@Override
25+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
26+
return Collections.emptyList();
27+
}
28+
}

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
import { NativeModules } from 'react-native';
3+
4+
const { RNVideoEditor } = NativeModules;
5+
6+
export default RNVideoEditor;

ios/RNVideoEditor.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
#import "RCTBridgeModule.h"
3+
4+
@interface RNVideoEditor : NSObject <RCTBridgeModule>
5+
6+
@end
7+

ios/RNVideoEditor.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
#import "RNVideoEditor.h"
3+
4+
@implementation RNVideoEditor
5+
6+
- (dispatch_queue_t)methodQueue
7+
{
8+
return dispatch_get_main_queue();
9+
}
10+
RCT_EXPORT_MODULE()
11+
12+
@end
13+

0 commit comments

Comments
 (0)