Latest 0.1.5
Homepage https://github.com/niyaoyao/NYVideoKit
License MIT
Platforms ios 8.0
Frameworks UIKit, AVFoundation
Authors

CI Status
Version
License
Platform

Example

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

Requirements

Installation

Pod install

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

source '[email protected]:niyaoyao/NYVideoKitSpec.git'
platform :ios, '8.0' 
target 'project-target-name' do
pod 'NYVideoKit'

end

Access Permission during Runtime

[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

Add key-value elements below in Info.plist file to solve the crash issue.

<key>NSCameraUsageDescription</key>
<string>Please allow App to use Camera.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Please allow App to use Microphone.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Please allow App to use Photo Library Assests.</string>

Usage

To use recorder components, you must import the NYVideoKit first.


#import <NYVideoRecorder.h>

@interface ViewController ()

@property (nonatomic, strong) NYVideoRecorder *recorder;

@end

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.recorder startCapture];
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    [self.recorder stopCapture];
}

- (NYVideoRecorder *)recorder {
    if (!_recorder) {
        _recorder = [[NYVideoRecorder alloc] init];
        [_recorder setPreviewLayerFrame:self.view.frame];
    }
    return _recorder;
}

- (void)startRecord {
    if(self.recorder.recorderStatus != NYVideoRecorderStatusWriting) {
        [self.recorder startRecording];
        [self.button setTitle:@"⏸️" forState:UIControlStateNormal];
    } else {
        __weak typeof (self) weakSelf = self;
        [self.recorder stopRecording:^(NSError * _Nullable error) {
            if (error) {
                [self showMessage:error.localizedDescription];
            }
            [weakSelf.button setTitle:@"⏺️" forState:UIControlStateNormal];
        }];
    }
}

Author

niyaoyao, [email protected]

License

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

Latest podspec

{
    "name": "NYVideoKit",
    "version": "0.1.5",
    "summary": "NYVideoKit is a lightweight video synthesis library. NYVideoKit captures and records audio and video and saves it to a local sandbox.",
    "description": "NYVideoKit is a lightweight video synthesis library. NYVideoKit captures and records audio and video and saves it to a local sandbox. NYVideoKit also allows you to stitch, cut, add filters, add images, and more.",
    "homepage": "https://github.com/niyaoyao/NYVideoKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "niyaoyao": "[email protected]"
    },
    "source": {
        "git": "https://github.com/niyaoyao/NYVideoKit.git",
        "tag": "0.1.5"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "NYVideoKit/Classes/**/*",
    "frameworks": [
        "UIKit",
        "AVFoundation"
    ]
}

Pin It on Pinterest

Share This