MLAVPlayer 1.0.3

MLAVPlayer 1.0.3

MichaelLedger 管理。



  • MichaelLedger

MLAVPlayer

MLAVPlayer 视频与音频播放接口

使用示例

MLAVPlayer *player = [MLAVPlayer player];
//网络视频
//        player.videoURL = [NSURL URLWithString:@"https://media.w3.org/2010/05/sintel/trailer.mp4"];
//本地视频
//        player.videoURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"trailer" ofType:@"mp4"]];
//本地音频
player.videoURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"bbc20190709_21306935GX" ofType:@"mp3"]];
//是否循环播放
player.loopPlay = YES;
[player mas_makeConstraints:^(MASConstraintMaker *make) {
    make.edges.mas_equalTo(UIEdgeInsetsMake(60, 0, 80, 0));
}];
player.backBlock = ^{
    //处理返回按钮点击
};
player.scaleBlock = ^(BOOL fullScreen) {
    //处理缩放按钮点击
};
[player play];

注册 Cocoapods trunk

$ pod trunk register [email protected] MichaelLedger
[!] Please verify the session by clicking the link in the verification email that has been sent to [email protected]

将 .podsepc 文件上传到 git 的 Cocoapods/Specs 公开仓库

$ pod trunk push MLAVPlayer.podspec
Updating spec repo `master`
Validating podspec
-> MLAVPlayer (1.0.1)
- NOTE  | xcodebuild:  note: Using new build system
- NOTE  | [iOS] xcodebuild:  note: Planning build
- NOTE  | [iOS] xcodebuild:  note: Constructing build description

Updating spec repo `master`

--------------------------------------------------------------------------------
🎉  Congrats

🚀  MLAVPlayer (1.0.1) successfully published
📅  July 16th, 23:27
🌎  https://cocoapods.org.cn/pods/MLAVPlayer
👍  Tell your friends!
--------------------------------------------------------------------------------

Cocoapods: pod search 无法搜索到类库的解决办法

1、删除 ~/Library/Caches/CocoaPods 目录下的 search_index.json 文件

pod setup 成功后会生成 ~/Library/Caches/CocoaPods/search_index.json 文件。在终端输入 rm ~/Library/Caches/CocoaPods/search_index.json

2、删除成功后再执行 pod search

$ rm ~/Library/Caches/CocoaPods/search_index.json
$ pod search MLAVPlayer
-> MLAVPlayer (1.0.1)
Encapsulate AVPlayer
pod 'MLAVPlayer', '~> 1.0.1'
- Homepage: https://github.com/MichaelLedger/MLAVPlayer
- Source:   https://github.com/MichaelLedger/MLAVPlayer.git
- Versions: 1.0.1 [master repo]

更新 Release 版本(先将 .podspec 中的版本同步升级: spec.version = "1.0.2"

$ git tag 1.0.2
$ git push origin 1.0.2
remote: Permission to MichaelLedger/MLAVPlayer.git denied to DevaLee.
fatal: unable to access 'https://github.com/MichaelLedger/MLAVPlayer.git/': The requested URL returned error: 403

Git clone 成功但 git push 却出现 403 错误的解决方案

  1. 在代码的 .git/config 文件内 [remote “origin”] 的 url 的 gitlab 域名前添加 gitlab 注册时的“用户名:密码@”
  2. 这个用户要在对应项目下的角色是 Owner 或 Master 才行,如果是 Guest、Reporter、Developer,则如下操作后也是不行。
$ git config remote.origin.url https://<username>:<password>@github.com/MichaelLedger/MLAVPlayer.git
$ git push origin 1.0.2
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/MichaelLedger/MLAVPlayer.git
* [new tag]         1.0.2 -> 1.0.2

标签提交完毕后即可上传升级后的 .podspec 文件到 git 的 Cocoapods/Specs 公开仓库

$ pod trunk push MLAVPlayer.podspec
Updating spec repo `master`

CocoaPods 1.7.5 is available.
To update use: `gem install cocoapods`

For more information, see https://blog.cocoapods.org.cn and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.7.5

Validating podspec
-> MLAVPlayer (1.0.2)
- NOTE  | xcodebuild:  note: Using new build system
- NOTE  | [iOS] xcodebuild:  note: Planning build
- NOTE  | [iOS] xcodebuild:  note: Constructing build description

Updating spec repo `master`

CocoaPods 1.7.5 is available.
To update use: `gem install cocoapods`

For more information, see https://blog.cocoapods.org.cn and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.7.5


--------------------------------------------------------------------------------
🎉  Congrats

🚀  MLAVPlayer (1.0.2) successfully published
📅  July 22nd, 04:52
🌎  https://cocoapods.org.cn/pods/MLAVPlayer
👍  Tell your friends!
--------------------------------------------------------------------------------