QRVideoRecord
示例
要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install
。
要求
Basic usage
QRVideoRecordViewController *vc = [[QRVideoRecordViewController alloc] init];
vc.delegate = (id <QRVideoRecordDelegate>)self;
[self presentViewController:vc animated:YES completion:nil];
/**
* video record result
* @param fileURL video local url
* @param filePath video local path
* @param fileName video name
* fileURL will be triggered after video recording is finished.
*/
- (void)finishVideoRecordCapture:(NSURL *)fileURL filePath:(NSString *)filePath fileName:(NSString *)fileName;
If you want to expand...
Please use inherit
#import <QRVideoRecord/QRVideoRecordViewController.h>
@interface LBQRViewController : QRVideoRecordViewController
@end
other usage
/**
* cut out video preview
* @param url video local url
* @return video preview
* video preview expect get video the first frame
*/
+ (UIImage*)getVideoPreViewImage:(NSURL *)url;
/**
* calculation out video file size
* @param path video local url
* @return video size
* video size unit is MB
*/
+ (CGFloat)fileSize:(NSURL *)path;
/**
* disk address
* you can get the video folder stored in the local sandbox, so that you can manage the sandbox storage.
*/
+ (NSString *)getVideoContents;
/**
* clear video disk folder
* if the memory of the mobile phone is too small, the video recording will fail. We hope to clean up the video files in the local sandbox when the page is destroyed.
*/
+ (BOOL)clearVideoContents;
other expand
/**
* flash lamp
* set this property so that you can set up and turn off the astigmatism conveniently.
* expand property
*/
@property (nonatomic, assign) AVCaptureFlashMode flashMode;
/**
* camera direction
* set this property So that you can easily change the front and rear cameras.
* expand property, nullable property
*/
@property (nonatomic, assign) AVCaptureDevicePosition devicePosition;
/**
* video record result call.
* you can do your video recording after completion, such as jump page.
* The extension must first call the parent class method. use super doNextWhenVideoSavedSuccess will be call fileURL completion
*/
- (void)doNextWhenVideoSavedSuccess;
安装
QRVideoRecord 通过 CocoaPods 提供。要安装它,简单地将以下行添加到 Podfile 中
pod 'QRVideoRecord'
作者
yangqingren,[email protected]
许可
QRVideoRecord采用MIT许可。更多详情请参阅LICENSE文件。