★ wanayoo — archive 1999 https://github.com/piemonte/PBJVisionNouvelle recherche | Portail wanayoo
This repository
This repository
All repositories

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS, or Subversion.

Download ZIP

iOS camera engine, supports touch-to-record video and photo capture

Objective-CRuby
branch: master
Switch branches/tags
Nothing to show
Nothing to show
README.md

PBJVision

PBJVision

'PBJVision' is an iOS camera engine that supports touch-to-record video and photo capture.

It supports both iOS 6 and iOS 7 as well as 64-bit.

We created this at DIY.org as a fun means for kids to author video but also as a way to easily create stop motion. This same recording interaction was pioneered by Vine and later by Instagram.

Release History

v0.1.2 addition of onion skinning (ghosting), http://en.wikipedia.org/wiki/Onion_skinning

v0.1.1 minor bug fixes

v0.1.0 initial release of touch-to-record video

Installation

CocoaPods is the recommended method of installing PBJVision, just add the following line to your Podfile:

Podfile

pod 'PBJVision'

Usage

#import "PBJVision.h"
- (void)_setup
{
    _longPressGestureRecognizer.enabled = YES;

    PBJVision *vision = [PBJVision sharedInstance];
    vision.delegate = self;
    [vision setCameraMode:PBJCameraModeVideo];
    [vision setCameraDevice:PBJCameraDeviceBack];
    [vision setCameraOrientation:PBJCameraOrientationPortrait];
    [vision setFocusMode:PBJFocusModeAutoFocus];

    [vision startPreview];
}
- (void)_handleLongPressGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
{
    switch (gestureRecognizer.state) {
      case UIGestureRecognizerStateBegan:
        {
            if (!_recording)
                [[PBJVision sharedInstance] startVideoCapture];
            else
                [[PBJVision sharedInstance] resumeVideoCapture];
            break;
        }
      case UIGestureRecognizerStateEnded:
      case UIGestureRecognizerStateCancelled:
      case UIGestureRecognizerStateFailed:
        {
            [[PBJVision sharedInstance] pauseVideoCapture];
            break;
        }
      default:
        break;
    }
}
- (void)_handleDoneButton:(UIButton *)button
{
    [self _endCapture];
}
- (void)vision:(PBJVision *)vision capturedVideo:(NSDictionary *)videoDict error:(NSError *)error
{   
    NSString *videoPath = [_currentVideo  objectForKey:PBJVisionVideoPathKey];
    [_assetLibrary writeVideoAtPathToSavedPhotosAlbum:[NSURL URLWithString:videoPath] completionBlock:^(NSURL *assetURL, NSError *error1) {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Saved!" message: @"Saved to the camera roll."
                                                       delegate:self
                                              cancelButtonTitle:nil
                                              otherButtonTitles:@"OK", nil];
        [alert show];
    }];
}
Something went wrong with that request. Please try again.