0.0.2 • Published 7 years ago
aeonmatrix-react-native-ijkplayer v0.0.2
Setup
$ npm install aeonmatrix-react-native-ijkplayerAndroid
Add below to
android/settings.gradle(betweenrootProject.name = 'projectName'andinclude ':app')include ':aeonmatrix-react-native-ijkplayer' project(':aeonmatrix-react-native-ijkplayer').projectDir = new File(rootProject.projectDir, '../node_modules/aeonmatrix-react-native-ijkplayer/android')Add below to
android/app/build.gradledependencies { ... compile project(':aeonmatrix-react-native-ijkplayer') // Add this line } // And these lines repositories { flatDir { dirs project(':aeonmatrix-react-native-ijkplayer').file('libs') } }Add below to
android/app/src/main/java/com/<yourProjectName>/MainApplication.javaimport com.aeonmatrix.reactnativeijkplayer.RNIjkplayerPackage; // Add this line ... ... ... @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new RNIjkplayerPackage() // Add this line ); }Add below to
android/app/src/main/AndroidManifest.xml<activity android:name="com.aeonmatrix.reactnativeijkplayer.ijkplayerActivity" />
iOS
In Xcode. Right click
Libraries-> Add files to "\<yourProjectName>" -> Selectnode_modules/aeonmatrix-react-native-ijkplayer/ios/RNIjkplayer.xcodeprojBuild Phases -> Link Binary With Libraries -> click "+" -> Select
libRNIjkplayer.aBuild 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>