视频录制bug修复

This commit is contained in:
kai60
2020-10-19 22:17:35 +08:00
parent 52c13cc416
commit 0611c6147b
12 changed files with 85 additions and 34 deletions
@@ -45,10 +45,12 @@ static const CGFloat ToastFade = 0.2;
- (void)viewDidLoad {
[super viewDidLoad];
[self connectDevice];
// Do any additional setup after loading the view.
[self addTitleViewWithTitle:@"录制视频"];
self.recordType=[[DataCenter defaultDtacenter].cache stringForKey:@"recordType"];
if (self.recordType.length)
if (!self.recordType.length)
{
self.recordType=@"0";
}
@@ -72,6 +74,7 @@ static const CGFloat ToastFade = 0.2;
self.tab.scrollEnabled = NO;
//self.tab.backgroundColor = RGB(242, 242, 242);
[self.view addSubview:self.tab];
[self.tab reloadData];
}
-(void)connectDevice{
@@ -252,7 +255,7 @@ static const CGFloat ToastFade = 0.2;
}else{
_mydatepicView.resultString=[NSString stringWithFormat:@"%@:%@-%@:%@",_mydatepicView.startString,_mydatepicView.endString,_mydatepicView.startString1,_mydatepicView.endString1];
[[DataCenter defaultDtacenter].cache setString:_mydatepicView.resultString forKey:@"schduleRecordTime"];
[[DataCenter defaultDtacenter].cache setSynString:_mydatepicView.resultString forKey:@"schduleRecordTime"];
[_mydatepicView removeFromSuperview];
@@ -274,7 +277,11 @@ static const CGFloat ToastFade = 0.2;
if (btn.selected)
{
self.recordType=@"1";
[[DataCenter defaultDtacenter].cache setString:self.recordType forKey:@"recordType"];
[[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"];
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
}];
[[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeManual withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
if (success)
@@ -287,10 +294,14 @@ static const CGFloat ToastFade = 0.2;
}
}];
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:YES withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
}];
}else
{
self.recordType=@"0";
[[DataCenter defaultDtacenter].cache setString:self.recordType forKey:@"recordType"];
[[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"];
[[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeAlarm withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
NSLog(@"data=%@",dataDictionary);
@@ -300,6 +311,9 @@ static const CGFloat ToastFade = 0.2;
}];
[[GWP2PClient sharedClient] setDeviceAlarmRecordTime:3 withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
}];
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:NO withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
}];
}
@@ -319,8 +333,10 @@ static const CGFloat ToastFade = 0.2;
if (btn.selected) {
self.recordType=@"2";
[[DataCenter defaultDtacenter].cache setString:self.recordType forKey:@"recordType"];
[[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"];
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:NO withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
}];
[[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeSchedule withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
NSLog(@"data=%@",dataDictionary);
}];
@@ -348,7 +364,7 @@ static const CGFloat ToastFade = 0.2;
}else{
self.recordType=@"0";
[[DataCenter defaultDtacenter].cache setString:self.recordType forKey:@"recordType"];
[[DataCenter defaultDtacenter].cache setSynString:self.recordType forKey:@"recordType"];
[[GWP2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeAlarm withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
NSLog(@"data=%@",dataDictionary);
@@ -358,6 +374,9 @@ static const CGFloat ToastFade = 0.2;
}];
[[GWP2PClient sharedClient] setDeviceAlarmRecordTime:3 withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
}];
[[GWP2PClient sharedClient] setDeviceManuallyRecordState:NO withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
}];
}
[self.tab reloadData];