美文网首页
IJKPlayer IOS 编译流程

IJKPlayer IOS 编译流程

作者: James_Geng | 来源:发表于2019-06-25 14:38 被阅读0次

    996.icu

    1,Clone 项目及编译 ffmpeg

    GitHub:https://github.com/bilibili/ijkplayer

    Build IOS:

    git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-ios
    cd ijkplayer-ios
    git checkout -B latest k0.8.8
    
    ./init-ios.sh
    
    

    xCode10+ 以上版本对armv7 架构支持出错,请在compile-ffmpeg.sh 中移除 armv7 架构支持或使用xcode 9.1 编译:

    移除armv7架构:

    FF_ALL_ARCHS_IOS6_SDK="armv7 armv7s i386"
    FF_ALL_ARCHS_IOS7_SDK="armv7 armv7s arm64 i386 x86_64"
    FF_ALL_ARCHS_IOS8_SDK="arm64 i386 x86_64"
    
    FF_ALL_ARCHS=$FF_ALL_ARCHS_IOS8_SDK
    
    

    编译ffmpeg:

    ./compile-ffmpeg.sh clean
    ./compile-ffmpeg.sh all
    

    如仍需编译armv7 请按如下步骤:

    • download xcode 9.1
    • sudo xcode-select -s pathToXcode9.1/Contents/Developer
    • ./compile-ffmpeg.sh clean
    • ./compile-ffmpeg.sh all

    2,编译Openssl (支持Https)

    • 1, ./init-ios-openssl.sh //I did missed this step
    • 2, ./init-ios.sh

    then cd ios

    • 3.1 ./compile-openssl.sh clean //if u did compiled before
    • 3.2 ./compile-ffmpeg.sh clean //if u did compiled before
    • 4.1 ./compile-openssl.sh all
    • 4.2 ./compile-ffmpeg.sh all

    3,添加IJKMediaFrameworkWithSSL 库

    • build Phases -> Target Dependencies/Link Binary With Libraries 中添加IJKMediaFrameworkWithSSL
    • build Phases -> 点击左上角“+”号 添加Copy Files 选项,Destination 选择Frameworks 添加 IJKMediaFrameworkWithSSL.framework
    • build settings -> linking ->runpath search path add:@executable_path/Frameworks
    • 修改头文件引用
      #import <IJKMediaFrameworkWithSSL/IJKMediaFrameworkWithSSL.h>
      //#import <IJKMediaFramework/IJKMediaFramework.h>
      
    • 编译项目

    相关文章

      网友评论

          本文标题:IJKPlayer IOS 编译流程

          本文链接:https://www.haomeiwen.com/subject/jljtcctx.html