BMPlayer - 基于 AVPlayer 使用 Swift 封装的视频播放器
https://www.ctolib.com/BMPlayer.html
BMPlayer
A video player for iOS, based on AVPlayer, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.
Features
- Support for horizontal and vertical play mode
- Support play online URL and local file
- Adjust brightness by slide vertical at left side of screen
- Adjust volume by slide vertical at right side of screen
- Slide horizontal to fast forward and rewind
- Support multi-definition video
- Custom playrate
- Add Http header and other options to AVURLAsset
- Easy to customize
- Supporting show local and online subtitles
- Swift 4
Requirements
Installation
CocoaPods
Swift | podfile |
---|---|
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
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
- Subclass
BMPlayerControlView
to create your personal control UI, check the Example. - Use the
BMPlayerLayer
with your own player control view.
Demonstration
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.