0.0.2 • Published 6 years ago

aeonmatrix-react-native-ijkplayer v0.0.2

Weekly downloads
6
License
-
Repository
-
Last release
6 years ago

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>

0.0.2

6 years ago

0.0.1

6 years ago