VKTrimmerView

@IBDesignable
public class VKTrimmerView : VKAssetTimeSelector

A view to select a specific time range of a video. It consists of an asset preview with thumbnails inside a scroll view, two handles on the side to select the beginning and the end of the range, and a position bar to synchronize the control with a video preview, typically with an AVPlayer. Load the video by setting the asset property. Access the startTime and endTime of the view to get the selected time

Properties

  • The corresponding clip for the trimmer (set this to know which clip you need to trim)

    Declaration

    Swift

    public var clip: VKRecorderClip?

Color Customization

  • The background color of the main border of the view

    Declaration

    Swift

    @IBInspectable
    public var borderColor: UIColor { get set }
  • The color of the handles on the side of the view

    Declaration

    Swift

    @IBInspectable
    public var trimHandleColor: UIColor { get set }
  • The color of the handles on the side of the view when highlighted (is moving or has been trimmed)

    Declaration

    Swift

    @IBInspectable
    public var trimHandleHighlightColor: UIColor
  • The color of the border/background for the handles when highlighted (is moving or has been trimmed)

    Declaration

    Swift

    @IBInspectable
    public var trimBorderHighlightColor: UIColor
  • Border radius for controls

    Declaration

    Swift

    @IBInspectable
    public var borderRadius: CGFloat
  • The color of the position scroller

    Declaration

    Swift

    @IBInspectable
    public var scrollerColor: UIColor { get set }
  • The color used to mask unselected parts of the video

    Declaration

    Swift

    @IBInspectable
    public var maskColor: UIColor { get set }

Interface

Constraints

  • The minimum duration allowed for the trimming. The handles won’t pan further if the minimum duration is attained.

    Declaration

    Swift

    public var minDuration: Double

Time Equivalence

  • Move the position bar to the given time.

    Declaration

    Swift

    public func seek(to time: CMTime)
  • The selected start time for the current asset.

    Declaration

    Swift

    public var startTime: CMTime? { get }
  • The selected end time for the current asset.

    Declaration

    Swift

    public var endTime: CMTime? { get }

Scroll View Delegate