环境:
1:ubuntu 系统 (windows 交叉编译问题和某些脚本不能识别,放弃了windows 系统;MAC系统可以的,)
2:SDK
3:NDK (用版本为10e 的,其它的版本会出现版本的问题,,目前只能用该版本,下载链接:https://developer.android.google.cn/ndk/downloads/older_releases.html?hl=zh-cn)
4:Git
编译流程(具体流程可以参考官方[https://github.com/bilibili/ijkplayer]):
1:git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-android
2:cd ijkplayer-android
3:git checkout -B latest k0.8.8
4:./init-android.sh
5:cd android/contrib
6:./compile-ffmpeg.sh clean
7:./compile-ffmpeg.sh all
8:cd ..
9:./compile-ijk.sh all
# Android Studio:
# Open an existing Android Studio project
# Select android/ijkplayer/ and import
#
# define ext block in your root build.gradle
# ext {
# compileSdkVersion = 23 // depending on your sdk version
# buildToolsVersion = "23.0.0" // depending on your build tools version
#
# targetSdkVersion = 23 // depending on your sdk version
# }
#
# If you want to enable debugging ijkplayer(native modules) on Android Studio 2.2+: (experimental)
# sh android/patch-debugging-with-lldb.sh armv7a
# Install Android Studio 2.2(+)
# Preference -> Android SDK -> SDK Tools
# Select (LLDB, NDK, Android SDK Build-tools,Cmake) and install
# Open an existing Android Studio project
# Select android/ijkplayer
# Sync Project with Gradle Files
# Run -> Edit Configurations -> Debugger -> Symbol Directories
# Add "ijkplayer-armv7a/.externalNativeBuild/ndkBuild/release/obj/local/armeabi-v7a" to Symbol Directories
# Run -> Debug 'ijkplayer-example'
# if you want to reverse patches:
# sh patch-debugging-with-lldb.sh reverse armv7a
#
# Eclipse: (obselete)
# File -> New -> Project -> Android Project from Existing Code
# Select android/ and import all project
# Import appcompat-v7
# Import preference-v7
#
# Gradle
# cd ijkplayer
# gradle
以上操作没有问题后,可以用Android Studio 打开工程,工程目录为:ijkplayer-android\android\ijkplayer
本人成功打开后,用Android Studio 开启的工程已经上传到Github上
项目Demo链接
网友评论