浏览代码

update readme and custom compile

Caijinglong 6 年之前
父节点
当前提交
9bc2e3286d
共有 5 个文件被更改,包括 398 次插入11 次删除
  1. 2 5
      README-EN.md
  2. 3 5
      README.md
  3. 5 1
      TODOLIST.md
  4. 197 0
      compile-cn.md
  5. 191 0
      compile.md

+ 2 - 5
README-EN.md

@@ -28,11 +28,8 @@ dependencies:
 Compilation options for ijkplayer:
 https://github.com/CaiJingLong/flutter_ijkplayer_pod/blob/master/config/module.sh
 
-or see bilibili/ijkplayer or ffmepg
-
-The libraries currently in use are modified on the basis of the official 0.8.8 version of bilibili/ijkplayer.
-
-Modified source code can view [Gitee](https://gitee.com/kikt/ijkplayer_thrid_party).
+Custom compilation options:
+https://github.com/CaiJingLong/flutter_ijkplayer/blob/master/compile.md
 
 ### iOS
 

+ 3 - 5
README.md

@@ -8,8 +8,8 @@ ijkplayer,通过纹理的方式接入 bilibili/ijkplayer
 
 有关 android 可能跑不起来的问题会详细解释
 
-iOS模拟器不显示图像,所以调试请使用真机(iOS10 iOS 12.1.4亲测可用,其他版本有问题可反馈)
-android模拟器mac android sdk自带的emulator(API28 android9)可用,其他类型的没有亲测不保证
+iOS 模拟器不显示图像,所以调试请使用真机(iOS10 iOS 12.1.4 亲测可用,其他版本有问题可反馈)
+android 模拟器 mac android sdk 自带的 emulator(API28 android9)可用,其他类型的没有亲测不保证
 
 - android: 我这里 sdk 自带的模拟器可用(音视频均正常)
 - iOS: 库中包含了真机和模拟器的库文件,但是模拟器有声音,无图像
@@ -37,9 +37,7 @@ dependencies:
 
 编译规则可以参考这个,如果你有自己的特定需求,可以修改编译选项,这个参考 bilibili/ijkplayer 或 ffmpeg
 
-https://github.com/CaiJingLong/flutter_ijkplayer_pod/blob/master/config/module.sh
-
-当前使用的库在bilibili/ijiplayer官方0.8.8版本的基础上有所修改,源码可查询 https://gitee.com/kikt/ijkplayer_thrid_party
+自定义编译选项可以看[这里](https://github.com/CaiJingLong/flutter_ijkplayer/blob/master/compile-cn.md)
 
 ### iOS
 

+ 5 - 1
TODOLIST.md

@@ -44,7 +44,11 @@
   - [x] 使用选项切换音量的控制是系统音量还是资源音量
   - [x] 允许根据情况禁用各种控制手势
   - [x] 当一个视频是直播视频时,进度条应该隐藏,且无拖动进度相关手势
-  - [ ] 全屏按钮: 利用 Overlay 开发一个全屏的播放界面,不仅仅在 Example 中
+  - [ ] 全屏切换
+    - [ ] UI(控制器 UI 内)
+    - [ ] android
+    - [ ] iOS
+    - [ ] 利用 Overlay 开发一个全屏的播放界面,不仅仅在 Example 中
 - [x] 根据视频角度自动旋转
 - [x] 保证图片宽高比不失真
 - [x] 允许自定义控制器 UI

+ 197 - 0
compile-cn.md

@@ -0,0 +1,197 @@
+# 自定义编译选项
+
+本项目可以通过以下的方式自定义编译选项
+
+## 获取 ijkplayer 的源码
+
+这部分修改后的源码托管于 gitee
+
+`$ git clone https://gitee.com/kikt/ijkplayer_thrid_party.git ijkplayer`
+
+## 初始化及编译项目
+
+这部分主要参考官方的过程,如果你对于 ijkplayer 有所了解,可以跳过这部分,直接看后面的在 flutter 中使用环节
+
+如果这部分遇到问题可以去官方提问
+
+### 编译环境
+
+我这里是 macOS, 你如果是 linux,可以编译 android 部分
+
+只有在 macOS 下才能完成 iOS 部分的编译
+
+windows: 请放弃
+
+### 通用部分
+
+config/module.sh 是 ijkplayer 中 ffmpeg 的编译选项,你可以根据自己的需求去修改这部分代码, 这里的配置对于整体库文件的大小影响是最大的
+
+Mac 下必须的软件:
+git
+yasm
+
+因为后面有一些东西需要下载,所以建议你命令行能翻墙,不然可能会很慢(不翻墙一天可能下不完,翻墙 10 分钟内),另外浏览器翻墙和命令行不是一回事
+
+检测终端是否可翻墙`curl google.com`
+
+### android 部分
+
+需求:
+
+- NDK r10e (建议就使用这个,不要用高版本也不要用低版本,除非你很懂 ndk)
+- Xcode
+- Android SDK
+
+保证你的 git,yasm,都在环境变量中
+
+配置 andorid sdk 和 ndk 到环境变量中
+
+```bash
+export ANDROID_SDK=<your sdk path>
+export ANDROID_NDK=<your ndk path>
+```
+
+初始化
+
+```bash
+./init-config.sh # 初始化配置
+./init-android.sh # 初始安卓,这里可能会下载ffmpeg,耐心等待
+./init-android-openssl.sh  # 初始android的openssl, 如果你不需要https协议,可以跳过这一步
+```
+
+编译
+
+```bash
+cd android/contrib
+./compile-ffmpeg.sh clean
+./compile-openssl.sh clean
+./compile-openssl.sh all
+./compile-ffmpeg.sh all
+cd ..
+./compile-ijk.sh all
+```
+
+这里等待完成后,你就可以到你对应的 cpu 类型中去复制 so 文件,这里就是后续要用应用到项目中的库文件了
+
+![20190402140003.png](https://raw.githubusercontent.com/kikt-blog/image/master/img/20190402140003.png)
+替换掉`android/src/main/libs`下的文件就可以了
+
+### iOS
+
+初始化
+
+根目录下执行:
+
+```bash
+./init-config.sh
+./init-ios.sh
+./init-ios-openssl.sh
+```
+
+编译
+
+```bash
+cd ios
+./compile-openssl.sh clean
+./compile-ffmpeg.sh clean
+
+./compile-openssl.sh arm64
+./compile-openssl.sh x86_64
+./compile-openssl.sh i386
+./compile-openssl.sh lipo
+./compile-ffmpeg.sh arm64
+./compile-ffmpeg.sh x86_64
+./compile-ffmpeg.sh i386
+./compile-ffmpeg.sh lipo
+```
+
+这里有一个快捷方式,在 clean 后直接用
+`./compile-common.sh`
+就可以完成构建步骤了(这个脚本是我自己添加的)
+
+接下来的步骤需要在 xcode 中操作,我这里是 xcode10
+
+`$ open ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj`
+这里可以直接从 xcode 中打开这个项目
+
+这里不要选 SSL 那个项目
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205338.png)
+
+Edit Scheme
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205412.png)
+
+Release
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205454.png)
+
+编译模拟器的 command+b
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205548.png)
+
+选择 iOS Device
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205634.png)
+
+编译真机的 command+b
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205727.png)
+
+打开项目
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205727.png)
+
+找到 Products 级别
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205839.png)
+
+在命令行进入到这个目录
+
+比如 `$ cd ~/Library/Developer/Xcode/DerivedData/IJKMediaPlayer-bpuwtjeeipcfgffpcjhynhwsndig/Build/Products`
+
+合并真机和模拟器库为通用库
+
+```bash
+lipo -create Release-iphoneos/IJKMediaFramework.framework/IJKMediaFramework Release-iphonesimulator/IJKMediaFramework.framework/IJKMediaFramework -output IJKMediaFramework
+
+cp IJKMediaFramework Release-iphoneos/IJKMediaFramework.framework
+
+open Release-iphoneos/
+```
+
+这里的就是那个库文件了,iOS 中库是一个文件夹
+
+## 编译产物置入 flutter 项目
+
+1. 将项目 download 或 clone 到你的 flutter 项目中一个单独的文件夹
+
+2. 修改项目的 pubspec.yaml 修改
+
+从
+
+```yaml
+dependencies:
+  flutter_ijkplayer: ^0.x.x
+```
+
+修改为:
+
+```yaml
+dependencies:
+  flutter_ijkplayer:
+    path: ./flutter_ijkplayer
+```
+
+### iOS 篇
+
+复制这个 IJKMediaFramework.framework 文件夹到 `flutter_ijkplayer/iOS` 文件夹下,然后修改 podspec 文件
+
+![20190402141140.png](https://raw.githubusercontent.com/kikt-blog/image/master/img/20190402141140.png)
+修改这个文件为这样
+
+![20190402141203.png](https://raw.githubusercontent.com/kikt-blog/image/master/img/20190402141203.png)
+
+### andorid 篇
+
+复制所有生成的 ijkplayer 的 so 库文件到 `flutter_ijkplayer/android/src/main/libs/${CPU}`下并且替换
+
+## LICENSE
+
+本项目基于 bilibili/ijkplayer 的 0.8.8 版本开发,使用前你需要确定你的项目满足 ijkplayer 的使用条件
+
+项目中 iOS 有一部分代码来源于 https://github.com/jadennn/flutter_ijk 的选项,这部分的所有修改代码都基于 MIT 协议
+
+本人修改的框架代码部分均与 bilibili/ijkplayer 相同

+ 191 - 0
compile.md

@@ -0,0 +1,191 @@
+# Custom compilation options
+
+This project can customize compilation options in the following ways.
+
+## Get the source code for ijkplayer
+
+The modified source code is hosted on gitee.
+
+`$ git clone https://gitee.com/kikt/ijkplayer_thrid_party.git ijkplayer`
+
+## Initialization and compilation of projects
+
+This section mainly refers to the official process. If you know something about ijkplayer, you can skip this section and look directly at the following links in flutter.
+If this part encounters problems, you can ask questions officially.
+
+### Compiling environment
+
+I'm macOS here. If you're linux, you can compile the Android part.
+
+IOS compilation can only be completed under macOS.
+
+Windows: Please give up
+
+### General part
+
+This is the compilation option of ffmpeg in ijkplayer. You can modify this part of the code according to your own needs. The configuration here has the greatest impact on the size of the overall library file.
+
+Your mac must have the soft:
+
+- git
+- yasm
+
+Later, if you don't need the HTTPS protocol, you can skip all openssl-related initialization and compilation.
+
+### android
+
+- NDK r10e(Do not use higher versions, do not guarantee availability)
+- Xcode
+- Android SDK
+
+Make sure your git, yasm, are in the environment variable.
+
+Configure andorid SDK and NDK to environment variables.
+
+```bash
+export ANDROID_SDK=<your sdk path>
+export ANDROID_NDK=<your ndk path>
+```
+
+initial:
+
+```bash
+./init-config.sh
+./init-android.sh
+./init-android-openssl.sh
+```
+
+compile:
+
+```bash
+cd android/contrib
+./compile-ffmpeg.sh clean
+./compile-openssl.sh clean
+./compile-openssl.sh all
+./compile-ffmpeg.sh all
+cd ..
+./compile-ijk.sh all
+```
+
+After waiting here, you can copy so files in your corresponding CPU type. Here are the library files that will be applied to the project in the future.
+
+### iOS
+
+initial:
+
+```bash
+./init-config.sh
+./init-ios.sh
+./init-ios-openssl.sh
+```
+
+compile
+
+```bash
+cd ios
+./compile-openssl.sh clean
+./compile-ffmpeg.sh clean
+
+./compile-openssl.sh arm64
+./compile-openssl.sh x86_64
+./compile-openssl.sh i386
+./compile-openssl.sh lipo
+./compile-ffmpeg.sh arm64
+./compile-ffmpeg.sh x86_64
+./compile-ffmpeg.sh i386
+./compile-ffmpeg.sh lipo
+```
+
+Here's a quick way to use it directly after cleaning.
+`./compile-common.sh`
+
+The next step needs to be done in xcode. Here is Xcode 10.
+
+`$ open ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj`
+
+Don't choose the SSL project here.
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205338.png)
+
+Edit Scheme
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205412.png)
+
+Release
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205454.png)
+
+command+b to compile library.
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205548.png)
+
+choose iOS device
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205634.png)
+
+compile with `command+b`
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205727.png)
+
+open product
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205727.png)
+
+cd into Products
+![1](https://raw.githubusercontent.com/CaiJingLong/asset_for_picgo/master/20190322205839.png)
+
+cd dir in shell.
+
+such as: `$ cd ~/Library/Developer/Xcode/DerivedData/IJKMediaPlayer-bpuwtjeeipcfgffpcjhynhwsndig/Build/Products`
+
+lipo your device and simulator.
+
+```bash
+lipo -create Release-iphoneos/IJKMediaFramework.framework/IJKMediaFramework Release-iphonesimulator/IJKMediaFramework.framework/IJKMediaFramework -output IJKMediaFramework
+
+cp IJKMediaFramework Release-iphoneos/IJKMediaFramework.framework
+
+open Release-iphoneos/
+```
+
+The IJKMediaFramework.framework is a folder.
+
+## Compile the product into the flutter project
+
+1. Download or clone the project to a separate folder in your flutter project
+
+2. Edit your pubspec.yaml
+
+from
+
+```yaml
+dependencies:
+  flutter_ijkplayer: ^0.x.x
+```
+
+to
+
+```yaml
+dependencies:
+  flutter_ijkplayer:
+    path: ./flutter_ijkplayer
+```
+
+### With iOS
+
+Copy IJKMediaFramework.framework folder into `flutter_ijkplayer/iOS`,
+
+and edit your podspec file:
+
+From
+
+![20190402141140.png](https://raw.githubusercontent.com/kikt-blog/image/master/img/20190402141140.png)
+
+to
+
+![20190402141203.png](https://raw.githubusercontent.com/kikt-blog/image/master/img/20190402141203.png)
+
+### With andorid
+
+Copy all ijkplayer so files into `flutter_ijkplayer/android/src/main/libs/${CPU}` and replace all.
+
+## LICENSE
+
+The project base on bilibili/ijkplayer 's 0.8.8 version. Before you use it, you need to make sure that your project meets ijkplayer's requirements.
+
+Part of the iOS code in the project comes from https://github.com/jadennn/flutter_ijk, all of which are based on the MIT protocol.
+
+The protocol used in my modified framework code is the same as bilibili/ijkplayer.