BMPlayer - 基于 AVPlayer 使用 Swift 封装的视频播放器

https://www.ctolib.com/BMPlayer.html

BMPlayer

Swift 2.2 Swift 3.0 Carthage compatible Version License Platform Weibo FOSSA Status

A video player for iOS, based on AVPlayer, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.

中文说明

Features

Requirements

Installation

CocoaPods

Swiftpodfile
Swift 4.2 pod 'BMPlayer', '~> 1.2.0'
Swift 4.0 pod 'BMPlayer', '~> 1.0.0'
Swift 3.0 pod 'BMPlayer', '~> 0.9.1'
Swift 2.2 pod 'BMPlayer', '~> 0.3.3'

To test the experimental caching support with VIMediaCache, use

 

Carthage

Add BMPlayer in your Cartfile.

github "BrikerMan/BMPlayer"

Run carthage to build the framework and drag the built BMPlayer.framework into your Xcode project.

Demo

run pod install at Example folder before run the demo.

Usage (Support IB and code)

Set status bar color

Please add the View controller-based status bar appearance field in info.plist and change it to NO

IB usage

Direct drag IB to UIView, the aspect ratio for the 16:9 constraint (priority to 750, lower than the 1000 line), the code section only needs to achieve. See more detail on the demo.

Code implementation by SnapKit

 

Set video url

multi-definition video with cover

Add HTTP header for request

Listening to player state changes

See more detail from the Example project

Block

Delegate

Customize player

Needs to change before the player alloc.

Advanced Customize

Demonstration

gif

Reference:

This project heavily reference the Objective-C version of this project ZFPlayer, thanks for the generous help of ZFPlayer's author.

Contact me:

Contributors

You are welcome to fork and submit pull requests.

License

BMPlayer is available under the MIT license. See the LICENSE file for more info.

posted @ 2019-04-08 15:08  sundayswift  阅读(1440)  评论(0编辑  收藏  举报