1、配置环境和下载ijkplayer源码,编译步骤参照 http://www.jianshu.com/p/5218f8c952fb;
git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-ios
cd ijkplayer-ios
git checkout -B latest k0.6.2
./init-ios.sh
cd ios
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all
2、编译完成后,打开IOS文件夹下面的IJKMediaPlayer,编译IJKMediaFramework.framework;
3、新建项目,将 IJKMediaFramework.framework 导入到项目中,调用接口即可;
集成过程中遇到的问题:
1、将 IJKMediaFramework.framework 导入到项目中,编译的时候 报错:
Undefined symbols for architecture x86_64:
"_clock_gettime", referenced from:
_av_gettime_relative in IJKMediaFramework(time.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决办法:我的Mac上安装了xcode7 和Xcode8,可能是系统默认用Xcode8去编译的ijkplayer,我用Xcode7打开项目时就会出现这个问题,换成Xcode8就没问题了;
参照:https://github.com/Bilibili/ijkplayer/issues/2094
2、集成我jkplayer 后播放本地 mp4视频,只有声音没有图像:
解决办法:默认编译配置裁掉了 mp4v,用下面的办法启用所有编码格式。
rm config/module.sh
ln -s config/module-default.sh config/module.sh
参照:https://github.com/Bilibili/ijkplayer/issues/184
来源:oschina
链接:https://my.oschina.net/u/2615608/blog/806978