Giter VIP home page Giter VIP logo

videotrimmercontrol's Introduction

VideoTrimmerControl

A VideoTrimmer Control for iOS that supports trimming & scrubbing

This VideoTrimmer Control for iOS allows the user to define how a video should be trimmed by dragging the side handles. When the user is trimming, pausing for a brief moment zooms in on the timeline to allow for greater precision. The timeline shows thumbnails of the video frames, based on AVAsset. Besides trimming, the control also optionallu allows the user to scrub through the video by tapping on the timeline.

Screenshots

The control when not interacting:

VideoTrimmer Screenshot when not interacting

The control when the user trimmed the leading and trailing parts:

VideoTrimmer Screenshot when trimmed

The control when the user is trimming the leading part:

VideoTrimmer Screenshot when trimming the leading part

The control when the user has zoomed in on the timeline:

VideoTrimmer Screenshot when zoomed in on the timeline

Animated GIF of the Control in Action

Animated GIF of the control in action

Configuration

  • asset: the asset to use for thumbnails. Setting this automatically updates the range and selectedRange properties
  • videoComposition: the AVVideoComposition to use (see AVFoundation)
  • minimumDuration: the minimal duration that a video can be. The user can't trim a clip shorter than this
  • range: the range of the asset to use
  • selectedRange: the range that is selected by the user. If nothing is trimmed, is equal to range.
  • progressIndicatorMode: defines how the progress indicator is shown hiddenOnlyWhenTrimming, alwaysShown or alwaysHidden
  • progress: the progress of the movie (e.g. current position when playing)
  • horizontalInset: the inset from the sides where the timeline and thumbs start. Defaults to 16. (Allows for overshooting when zooming)
  • trackBackgroundColor: background color for the timeline track
  • thumbRestColor: background color for the timeline parts where there is no video, but the thumbs rest when not trimmed

State Properties:

  • trimmingState: none if the user is not trimming, leading if they're trimming from the front, trailing if they're trimming from the end
  • isZoomedIn: true is the user zoomed in the timeline while trimming
  • isScrubbing: true if the user is scrubbing
  • visibleRange: the range that's currently displayed. Could be different from range when zoomed in
  • selectedTime: the time that's currently selected when trimming

Gesture Recognizers

You can configure the following gesture recognizers to require failure of, for example, a UITableView's panGestureRecognizer:

  • leadingGestureRecognizer
  • trailingGestureRecognizer
  • progressGestureRecognizer
  • thumbnailInteractionGestureRecognizer

Events:

  • VideoTrimmer.didBeginTrimming: fired when the user started trimming
  • VideoTrimmer.didEndTrimming: fired when the user stopped trimming
  • VideoTrimmer.selectedRangeChanged: fired when the selectedRange property changed because of the user trimming
  • didBeginScrubbing: fired when the user started scrubbing through the video
  • didEndScrubbing: fired whe nthe user ended scrubbing
  • progressChanged: fired when the progress property changed because of the user scrubbing

videotrimmercontrol's People

Contributors

andreasverhoeven avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.