Latest 0.1.0
Homepage https://github.com/frost101207/SegmentedVideoController
License Apache License, Version 2.0
Platforms ios 8.0
Authors

a ViewController that creates multiple progress bars at the top of the screen based on timestamps, tapping on the left or right side of the screen allows the user to jump to the next or previous timestamp. At the end of the video, the viewController dismisses itself.

todo: add screenshots/video

Installation

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

pod "SegmentedVideoController"

Implement the ‘SegmentedVideoPlayerViewControllerDataSource’ protocol and set the dataSource on SegmentedVideoPlayerViewController. The datasource function contains the following functions:

urlForVideo() -> URL? 
func jumpTimestampsInSeconds() -> [Double]

urlForVideo() should return the URL of the video you would like the SegmentedVideoPlayerController to play, and jumpTimestampsInSeconds() should contain an array of the timestamp (in seconds) of the points you would like the video to split. Each timestamp will result in another segment appearing at the top of the screen and left/right tapping will cause the video to jump to the previous or next segment.

Example of protocol implementation:

extension ViewController: SegmentedVideoPlayerViewControllerDataSource {
    func urlForVideo() -> URL? {
        guard let path = Bundle.main.path(forResource: "video_name", ofType:"mp4") else {
            return nil
        }
        return URL(fileURLWithPath: path)
    }
    func jumpTimestampsInSeconds() -> [Double] {
        return [7.2166, 15.1166, 23.0833, 29.2333, 38.1833, 48.4, 59.2166]
    }
}

Author

frost101207, chrislee@soothe.com

License

SegmentedVideoController is available under the Apache license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SegmentedVideoController",
    "version": "0.1.0",
    "summary": "A ViewController which plays a video with a segmented progress bar that allows tapping left and right to jump between the segments",
    "description": "a ViewController that creates multiple progress bars at the top of the screen based on timestamps, tapping on the left or right side of the screen allows the user to jump to the next or previous timestamp. At the end of the video, the viewController dismisses itself.",
    "homepage": "https://github.com/frost101207/SegmentedVideoController",
    "license": {
        "type": "Apache License, Version 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "frost101207": "chrislee@soothe.com"
    },
    "source": {
        "git": "https://github.com/frost101207/SegmentedVideoController.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SegmentedVideoController/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This