The previous article "Linux compile ijkplayer Android platform so library" describes how to compile to get the App project required ijkplayer so file, the next step is to import the official case project to the new version of Android Studio, in order to carry out the subsequent App debugging and development work.
Here we take Android Studio Dolphin (small dolphin version) as an example to introduce how to import and use ijkplayer library in the app project, the detailed steps are as follows.
I. Modify the Gradle version of the case project
Open gradle/wrapper/ in the case study project and configure the following line
Change the configuration to the following line
That is, upgrade the Gradle version version from 2.14.1 to 5.4.1.
II. Modification of the project level
Open the project level and complete the following three changes in sequence.
1, put the following line jcenter configuration
Replace the repository configuration with the following
2. Put the following lines of Gradle version information
Replace the Gradle version information with the following
3, put the following lines of SDK version information
Replace the SDK version information with the following
III. Modification of the module level
Open each module's and complete the following three changes in turn.
1. Replace all the compiles in each module with implementation.
2. Replace all "minSdkVersion 9" with "minSdkVersion 21" in each module.
3, open ijkplayer-example module alone, first productFlavors and a few lines of all32Compile and all64Compile are commented out, and then the following configuration of the guide package
Replace it with the following package guide configuration, that is, upgrade the support library to version 28.0.0.
Fourth, import the compiled so file
Put the three so files compiled according to "Compiling ijkplayer's Android platform so libraries for Linux" into the src/main/jniLibs/arm64-v8a directory of the ijkplayer-example module, so that Android Studio will automatically load the so files here when compiling.
V. Add playback code for live links
Open the ijkplayer-example module's and add the following playback code at the end of the onCreate method.
After the above five steps of modification, compile and run the app project of ijkplayer-example module, and see the ijkplayer playback interface on the real machine as shown in the following figure.
It can be seen that the webcast address is successfully viewed on the case app through ijkplayer.
For more details on FFmpeg development see