QuickPlayer-Swift
Features
- Based on AVPlayer, the performance is not bad.
- Stream caching player, just customize your own path to cache video.
- Use URLSession and Swift 3.
Requirements
- iOS 8.0+
- Swift 4
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapodsTo integrate QuickPlayer into your Xcode project using CocoaPods, specify it in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target '<Your Target Name>' do
pod 'QuickPlayer'
endThen, run the following command:
$ pod installManually
Open Sample Project, build Aggrate in Xcode. Import framework to your own project.
Usage
-
Init Player
let player = QuickPlayer(frame: view.frame) -
Add player view.
view.addSubview(player.playerView) -
Set cover url or video url
player.preparePlay(coverUrl: #URL#)player.startPlayer(videoUrl: #URL#) -
Change video source
player.replaceCurrentItem(coverUrl: #URL#, videoUrl: #URL#)
Other
Contact
Follow and contact me on Sina Weibo or my Home Page. If you find an issue, just open a ticket. Pull requests are warmly welcome as well.
License
QuickPlayer is released under the MIT license. See LICENSE for details.