Skip to content

iAmrMohamed/AMVideoRangeSlider

Repository files navigation

AMVideoRangeSlider

iOS Video Range Slider in Swift

amvideorangeslider

Code

let videoRangeSlider = AMVideoRangeSlider(frame: CGRectMake(16, 16, 300, 20))
let url = NSBundle.mainBundle().URLForResource("video", withExtension: "mp4")
videoRangeSlider.videoAsset = AVAsset(URL: url!)
videoRangeSlider.delegate = self

Delegate Methods

func rangeSliderLowerThumbValueChanged() {
    print(self.videoRangeSlider.startTime.seconds)
}

func rangeSliderMiddleThumbValueChanged() {
    print(self.videoRangeSlider.currentTime.seconds)
}

func rangeSliderUpperThumbValueChanged() {
    print(self.videoRangeSlider.stopTime.seconds)
}

Installation

CocoaPods

You can install the latest release version of CocoaPods with the following command:

$ gem install cocoapods

CocoaPods v0.36 or later required

Simply add the following line to your Podfile:

platform :ios, '8.0' 
use_frameworks!

pod 'AMVideoRangeSlider', :git => 'https://github.com/iAmrMohamed/AMVideoRangeSlider.git' 

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate AMVideoRangeSlider into your Xcode project using Carthage, specify it in your Cartfile:

github "iAmrMohamed/AMVideoRangeSlider"

Requirements

  • iOS 8.0+
  • Xcode 7.3+

License

AMVideoRangeSlider is released under the MIT license. See LICENSE for details.