Latest 0.1.0
Homepage https://github.com/entotsu/VideoPager
License MIT
Platforms ios 8.0
Dependencies RxSwift, RxCocoa
Frameworks AVFoundation
Authors

[![CI Status](http://img.shields.io/travis/Takuya Okamoto/VideoPager.svg?style=flat)](https://travis-ci.org/Takuya Okamoto/VideoPager)
Version
License
Platform

Demo (GIF)

demo

Available UI

  • seekSlider: UISlider

  • playIcon: UIImage

  • pauseIcon: UIImage

  • playButton: UIButton

  • progressView: UIProgressView

  • currentTimeLabel: UILabel

  • remainTimeLabel: UILabel

  • activityIndicator: UIActivityIndicatorView

  • playSpeedButton: UIButton

  • speedRateList: [Float]

  • frontSkipButton: UIButton

  • backSkipButton: UIButton

  • topShadowHeight: CGFloat

  • bottomShadowHeight: CGFloat

  • shadowOpacity: CGFloat

  • fadeEnabledViews: [UIView]

Simple Usage

let videoPager = VideoPagerViewController()

videoPager.updateUrls(urls)

Custom Cell

class YourCell: VideoPagerCell {
  // your implementation
}

VideoPagerCustomUI

You can easily implement control UI by conforming to VideoPagerCustomUI.

class YourCell: VideoPagerCell, VideoPagerCustomUI {

    // VideoPagerCustomUI
    @IBOutlet weak var playButton: UIButton!
    @IBOutlet weak var seekSlider: UISlider!
}

Custom VideoPagerViewController


class CustomVideoPager: VideoPagerViewController {

    required init?(coder aDecoder: NSCoder) {
        // initialize with your cell
        let cellNib = UINib(nibName: "CustomCell", bundle: nil)
        super.init(coder: aDecoder, videoPagerCellNib: cellNib)
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // set urls
        updateUrls(urls)
    }

    override func configureCell(cell: VideoPagerCell, index: Int) {
        super.configureCell(cell, index: index)
        // you can configure your cell with this method
        if let cell = cell as? CustomCell {
            cell.urlLabel.text = urls[index]
        }
    }

    override func didSelectItemAtIndex(index: Int) {
        super.didSelectItemAtIndex(index)
        // you can add tap action
        activeCell?.playOrPause()
    }
}

Documentation

API document is here.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS8.0~

Installation

VideoPager is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "VideoPager"

and import to your swift file.

import VideoPager

Author

Takuya Okamoto, [email protected]

License

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

Latest podspec

{
    "name": "VideoPager",
    "version": "0.1.0",
    "summary": "Swipable Paging Video UI. and some control components is available.",
    "homepage": "https://github.com/entotsu/VideoPager",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Takuya Okamoto": "[email protected]"
    },
    "source": {
        "git": "https://github.com/entotsu/VideoPager.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": [
        "VideoPager/Classes/**/*",
        "VideoPager/Classes/*"
    ],
    "resources": "VideoPager/Assets/*.xcassets",
    "frameworks": "AVFoundation",
    "dependencies": {
        "RxSwift": [],
        "RxCocoa": []
    }
}

Pin It on Pinterest

Share This