Shvier / QuickPlayer-Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 4.

Requirements

  • iOS 8.1+
  • Swift 4

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate QuickPlayer into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
use_frameworks!

target '<Your Target Name>' do
    pod 'QuickPlayer'
end

Then, run the following command:

$ pod install

Manually

Open Sample Project, build Aggrate in Xcode. Import framework to your own project.

Usage

  1. Init Player
    let player = QuickPlayer(frame: view.frame)

  2. Add player view.
    view.addSubview(player.playerView)

  3. Set cover url or video url
    player.preparePlay(coverUrl: #URL#) player.startPlayer(videoUrl: #URL#)

  4. 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.

About

License:MIT License


Languages

Language:Swift 69.3%Language:Objective-C 19.9%Language:Ruby 10.8%