aeonmatrix-react-native-ijkplayer
v0.0.2
Published
ijkplayer's React-Native bridge for Yapp
Downloads
10
Readme
Setup
$ npm install aeonmatrix-react-native-ijkplayer
Android
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.gradle
dependencies { ... 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.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 ); }
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.xcodeproj
Build Phases -> Link Binary With Libraries -> click "+" -> Select
libRNIjkplayer.a
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>