Coder Social home page Coder Social logo

aragunz / icgvideotrimmer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itsmeichigo/icgvideotrimmer

0.0 2.0 0.0 611 KB

A library for quick video trimming, mimicking the behavior of Instagram's

License: MIT License

Ruby 3.04% Objective-C 96.96%

icgvideotrimmer's Introduction

ICGVideoTrimmer

A library for quick video trimming based on SAVideoRangeSlider, mimicking the behavior of Instagram's.

Screenshot

Note

I've made this very quickly so here's a list of things to do for improvements (pull requests are very much appreciated!):

  • Make panning thumb views smoother
  • Make ruller view more customizable
  • Bug fixes if any
  • More and more, can't remember right now hahha.

Getting started

Using CocoaPods:

Just add the following line in to your pod file:

pod 'ICGVideoTrimmer'

Manually add ICGVideoTrimmer as a library:

Drag and drop the subfolder named Source in your project and you are done.

Usage

Create an instance of ICGVideoTrimmer using interface builder or programmatically. Give it an asset and set the delegate. You can select theme color for the trimmer view and decide whether to show the ruler view by setting the properties. Finally, don't forget to call resetSubviews!

 [self.trimmerView setThemeColor:[UIColor lightGrayColor]];
 [self.trimmerView setAsset:self.asset];
 [self.trimmerView setShowsRulerView:YES];
 [self.trimmerView setDelegate:self];
 [self.trimmerView resetSubviews];

If necessary, you can also set your desired minimum and maximum length for your trimmed video by setting the properties minLength and maxLength for the trimmer view. By default, these properties are 3 and 15 (seconds) respectively.

You can also customize your thumb views by setting images for the left and right thumbs:

  [self.trimmerView setLeftThumbImage:[UIImage imageNamed:@"left-thumb"]];
  [self.trimmerView setRightThumbImage:[UIImage imageNamed:@"right-thumb"]];

Requirements

ICGVideoTrimmer requires iOS 7 and MobileCoreServices and AVFoundation frameworks. Honestly I haven't tested it with iOS 6 and below so I can't be too sure if it's compatible.

ARC

ICGVideoTrimmer uses ARC. If you are using ICGVideoTrimmer in a non-arc project, you will need to set a -fobjc-arc compiler flag on every ICGVideoTrimmer source files. To set a compiler flag in Xcode, go to your active target and select the "Build Phases" tab. Then select ICGVideoTrimmer source files, press Enter, insert -fobjc-arc and then "Done" to enable ARC for ICGVideoTrimmer.

Contributing

Contributions for bug fixing or improvements are welcome. Feel free to submit a pull request.

Licence

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

icgvideotrimmer's People

Contributors

itsmeichigo avatar streeter avatar jasondinh avatar

Watchers

James Cloos avatar Florent Tahiri 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.