多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ### 拉流-使用Bilibili/ijkplayer做拉流直播 [git地址](https://github.com/bilibili/ijkplayer.git) #### 编译 ios ``` git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-ios cd ijkplayer-ios git checkout -B latest k0.8.8 ./init-ios.sh cd ios ./compile-ffmpeg.sh clean ./compile-ffmpeg.sh all ``` 报错: ``` AS libavcodec/arm/aacpsdsp_neon.o ./libavutil/arm/asm.S:50:9: error: unknown directive .arch armv7-a ^ make: *** [libavcodec/arm/aacpsdsp_neon.o] Error 1 make: *** Waiting for unfinished jobs.... ``` 需要在`compile-ffmpeg.sh`删除 armv7 , 修改方法如下: ``` FF_ALL_ARCHS_IOS8_SDK="arm64 i386 x86_64" ``` 重新执行命令: ``` $ ./compile-ffmpeg.sh all ``` 用xcode打开 `ijkplayer-ios/ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj`,编译,选择release版本 ![屏幕快照 2019-09-14 下午9.03.39.png](https://i.loli.net/2019/09/14/cWI41kTqPmV7QBM.png) ![屏幕快照 2019-09-14 下午9.06.21.png](https://i.loli.net/2019/09/14/riUFWJCDaBXfwPm.png) #### 合并真机版本跟模拟机版本 ``` lipo -create "真机版本路径" "模拟器版本路径" -output "合并后的文件路径" ``` ### 用xcode编译 ijkplayer_ios_swift [git地址](https://github.com/zuoquan/ijkplayer_ios_swift) 把三方库IJKMediaFramework导入 ijkplayer_ios_swift 编译之后会有两个错误 - 缺少 **[SnapKit](https://github.com/SnapKit/SnapKit)** 克隆: ``` $ git clone https://github.com/SnapKit/SnapKit.git ``` 然后把`SnapKit.xcodeproj` 添加到项目中 - Pods_ijswift_framework丢失 删掉Pods目录下到文件,执行: ``` $ pod install ``` 然后执行: ``` $ pod deintegrate ``` 如果没有pod命令,则执行: ``` $ gem install cocoapods ``` ***** ### 推流-使用LFLiveKit做推流直播 [https://github.com/LaiFengiOS/LFLiveKit](https://github.com/LaiFengiOS/LFLiveKit) 下载 执行命令 ``` git clone https://github.com/LaiFengiOS/LFLiveKit.git ``` xcode 编译,选择LFLiveKit.framework ### SnapKit安装 [https://github.com/SnapKit/SnapKit#installation](https://github.com/SnapKit/SnapKit#installation)