# Setup

```
$ npm install aeonmatrix-react-native-ijkplayer
```

### Android

1.  Add below to `android/settings.gradle` (between `rootProject.name = 'projectName'` and `include ':app'`)

    ```
    include ':aeonmatrix-react-native-ijkplayer'
    project(':aeonmatrix-react-native-ijkplayer').projectDir = new File(rootProject.projectDir, '../node_modules/aeonmatrix-react-native-ijkplayer/android')
    ```

2.  Add below to `android/app/build.gradle`

    ```
    dependencies {
        ...
        compile project(':aeonmatrix-react-native-ijkplayer') // Add this line
    }

    // And these lines

    repositories {
        flatDir {
            dirs project(':aeonmatrix-react-native-ijkplayer').file('libs')
        }
    }
    ```

3.  Add below to `android/app/src/main/java/com/<yourProjectName>/MainApplication.java`

    ```
    import com.aeonmatrix.reactnativeijkplayer.RNIjkplayerPackage; // Add this line

    ...
    ...
    ...

    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new RNIjkplayerPackage() // Add this line
        );
    }
    ```

4.  Add below to `android/app/src/main/AndroidManifest.xml`

    ```
    <activity android:name="com.aeonmatrix.reactnativeijkplayer.ijkplayerActivity" />
    ```

### iOS

1.  In Xcode. Right click `Libraries` -> Add files to "\<yourProjectName\>" -> Select `node_modules/aeonmatrix-react-native-ijkplayer/ios/RNIjkplayer.xcodeproj`

2.  Build Phases -> Link Binary With Libraries -> click "+" -> Select `libRNIjkplayer.a`

3.  Build Phases -> Copy Bundle Resources -> click "+" -> Add Other -> select node_modules/aeonmatrix-react-native-ijkplayer/ios/IJKMoviePlayerViewController.xib

# Usage

```
import RNIjkplayer from 'aeonmatrix-react-native-ijkplayer'
```

### Function signature

`execute(rtspUrl: String, loading: String, error: String, ok: String): Promise<String>`
