完成ios端参数处理,ios端基本可用
This commit is contained in:
parent
02fa78b9e3
commit
bf248c7fc4
@ -35,6 +35,7 @@
|
||||
*/
|
||||
- (AVCaptureVideoPreviewLayer *)previewLayer;
|
||||
|
||||
+ (instancetype) createFromOption:(SGRecordOptions*)options;
|
||||
/**
|
||||
拍照
|
||||
|
||||
|
@ -44,12 +44,12 @@ typedef void(^PropertyChangeBlock)(AVCaptureDevice *captureDevice);
|
||||
@end
|
||||
|
||||
@implementation SGRecordManager
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.maxRecordTime = self.options.duration.intValue;
|
||||
}
|
||||
return self;
|
||||
|
||||
+ (instancetype) createFromOption:(SGRecordOptions*)options{
|
||||
SGRecordManager *manager =[[SGRecordManager alloc] init];
|
||||
manager.options = options;
|
||||
manager.maxRecordTime = manager.options.duration.floatValue;
|
||||
return manager;
|
||||
}
|
||||
|
||||
#pragma mark - 操作方法
|
||||
@ -198,8 +198,8 @@ typedef void(^PropertyChangeBlock)(AVCaptureDevice *captureDevice);
|
||||
//添加视频输出
|
||||
if ([_recordSession canAddOutput:self.videoOutput]) {
|
||||
[_recordSession addOutput:self.videoOutput];
|
||||
_cx = self.options.width;
|
||||
_cy = self.options.height;
|
||||
_cx = self.options.width.intValue;
|
||||
_cy = self.options.height.intValue;
|
||||
}
|
||||
//添加音频输出
|
||||
if ([_recordSession canAddOutput:self.audioOutput]) {
|
||||
|
@ -16,7 +16,8 @@
|
||||
#import "UIButton+Convenience.h"
|
||||
#import "SGRecordOptions.h"
|
||||
#import "SGMotionManager.h"
|
||||
|
||||
#define WEAKSELF __weak typeof(self) weakSelf = self;
|
||||
#define STRONGSELF __strong typeof(weakSelf) strongSelf = weakSelf;
|
||||
#define TIMER_INTERVAL 0.5 //定时器时间间隔
|
||||
#define RECORD_TIME 0.5 //开始录制视频的时间
|
||||
@interface SGRecordViewController ()<SGRecordEngineDelegate,UIGestureRecognizerDelegate,SGMotionManagerDeviceOrientationDelegate>
|
||||
@ -160,8 +161,7 @@
|
||||
#pragma mark - set、get方法
|
||||
- (SGRecordManager *)recordManger {
|
||||
if (!_recordManger) {
|
||||
_recordManger = [[SGRecordManager alloc] init];
|
||||
_recordManger.options = self.options;
|
||||
_recordManger = [SGRecordManager createFromOption: self.options];
|
||||
_recordManger.delegate = self;
|
||||
}
|
||||
return _recordManger;
|
||||
|
Loading…
x
Reference in New Issue
Block a user