Latest 2.0.0
Homepage https://github.com/prynt/PryntTrimmerView
License MIT
Platforms ios 9.0
Authors

codebeat badge
Platform
License
Version

A set of tools written in swift to crop and trim videos.

Example

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

Trimming

Cropping

Requirements

PryntTrimmerView requires iOS9: It uses Layout Anchors to define the constraints.

Installation

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

pod "PryntTrimmerView"

For swift 3 compatibility, you can use version 1.0.1 or below.

Usage

Trimming

Create a TrimmerView instance (in interface builder or through code), and add it to your view hierarchy.

trimmerView.asset = asset
trimmerView.delegate = self

Access the startTime and endTime property to know where to trim your asset. You can use the TrimmerViewDelegate to link the trimmer with an AVPlayer and provide the end user with a preview. See the VideoTrimmerViewController inside the project to see an example.

You can also customize the trimmer view by changing its colors:

trimmerView.handleColor = UIColor.white
trimmerView.mainColor = UIColor.orange
trimmerView.positionBarColor = UIColor.white

Cropping

Create an instance of the VideoCropView and add it to your view hierarchy, then load your video into the crop view: videoCropView.asset = asset.

You can set the aspect ratio you want using the setAspectRatio method. Once you are satisfied with the portion of the asset you want to crop, call getImageCropFrame to retrieve the select frame. See the VideoCropperViewController in the example app for an actual example of how to crop the video for export.

License

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

Latest podspec

{
    "name": "PryntTrimmerView",
    "version": "2.0.0",
    "summary": "A set of tools written in swift to help you trim and crop a video.",
    "description": "First tool is a trimmer view to help you select a portion of an AVAsset. It provides you with a customizablencomponent that indicates the portion of the video selected, thanks to image thumbnails of the asset.nSecond tool is a crop view, to preview a video and select the part of the video you want to crop.",
    "homepage": "https://github.com/prynt/PryntTrimmerView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "[email protected]": "[email protected]"
    },
    "source": {
        "git": "https://github.com/prynt/PryntTrimmerView.git",
        "tag": "2.0.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "PryntTrimmerView/Classes/**/*",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This