diff --git a/Ifish/Info.plist b/Ifish/Info.plist index 98304cf..2e9fc2c 100644 --- a/Ifish/Info.plist +++ b/Ifish/Info.plist @@ -70,7 +70,7 @@ CFBundleVersion - 9.9.1 + 9.9.4 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m index 727aecd..99c432e 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m @@ -241,20 +241,21 @@ Strong UIImage *screenShotImage;//截图 - (void)viewDidLoad { [super viewDidLoad]; - [self checkNetStatus]; self.isShowControllerBar = YES; self.isVideoModeHD = NO; _isReject=YES; _isStop = NO; _isPushNextView = NO; + if ([self.contact.isActive isEqualToString:@"1"]) { + [self connectDevice]; + } //监控竖屏时,各控件初始化(先) [self initComponentForPortrait]; //监控横屏时,各控件初始化(后) [self initComponentForHorizontalScreen]; if ([self.contact.isActive isEqualToString:@"1"]) { - [self connectDevice]; }else{ [self.yProgressView stop]; @@ -278,20 +279,21 @@ Strong UIImage *screenShotImage;//截图 NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; //初始化设备 if (!_connectDevice) { - NSLog(@"正在初始化设备"); + NSLog(@"正在检查P2P连接状态"); _connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil]; - [[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.contact.cameraId password:self.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { -// [self outputLog:dataDictionary success:success]; - //获取成功,打印设备信息,之后连接设备 - if (success) { - NSLog(@"当前连接设备信息:%@",dataDictionary); - } - }]; + if (_connectDevice) { + [[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.contact.cameraId password:self.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + //获取成功,打印设备信息,之后连接设备 + if (success) { + NSLog(@"当前连接设备信息:%@",dataDictionary); + } + }]; + } } if(!_connectDevice){//p2p连接失败 NSLog(@"p2pConnect failure.失败,不能操作设备"); - [self hiddenMonitoringUI:YES callWithErrorType:GWP2PCallErrorTimeout isReCall:NO]; + [self hiddenMonitoringUI:YES callWithErrorType:100 isReCall:NO]; return; } } @@ -311,7 +313,7 @@ Strong UIImage *screenShotImage;//截图 WEAK_SELF; dispatch_async(dispatch_get_global_queue(0, 0), ^{ - [weakSelf.player p2pCallDeviceWithDeviceId:self.contact.cameraId password:weakSelf.contact.cameraPass definition:GWP2PPTZDefinitionSD calling:^(NSDictionary *parameters) { + [weakSelf.player p2pCallDeviceWithDeviceId:self.contact.cameraId password:self.contact.cameraPass definition:GWP2PPTZDefinitionSD calling:^(NSDictionary *parameters) { //呼叫设备 NSLog(@"[p2pCallDevice-Calling],paras=%@",parameters); @@ -323,6 +325,7 @@ Strong UIImage *screenShotImage;//截图 _isReject=YES; NSLog(@"摄像头连接失败"); dispatch_async(dispatch_get_main_queue(), ^{ + [self.view makeToast:@"连接失败"]; [self hiddenMonitoringUI:NO callWithErrorType:(NSInteger)error isReCall:NO]; }); @@ -1292,49 +1295,6 @@ Strong UIImage *screenShotImage;//截图 } } } -#pragma mark 按下按钮时,响应 --(void)onVerticalBtnTouchDown:(UIButton *)button{ - switch(button.tag){ - case SOUND_BUTTON_H_TAG://声音 - { - - } - break; - case SWITCH_SCREEN_BUTTON_H_TAG://横屏 - { - - } - break; - case DEFENCE_BUTTON_H_TAG://布防撤防 - { - - } - break; - case TALK_BUTTON_H_TAG://按下开始对讲 - { - //非本地设备 - NSInteger deviceType1 = [AppDelegate sharedDefault].contact.contactType; - //本地设备 - NSInteger deviceType2 = [[FListManager sharedFList] getType:[[P2PClient sharedClient] callId]]; - if (deviceType1 != CONTACT_TYPE_DOORBELL && deviceType2 != CONTACT_TYPE_DOORBELL) {//不支持门铃,按下开始对讲 - [self.pressView setHidden:NO]; - //[[PAIOUnit sharedUnit] setSpeckState:NO]; - } - - } - break; - case SCREENSHOT_BUTTON_H_TAG://载图 - { - - } - break; - case PROMPT_BUTTON_TAG://重新连接监控 - { - - } - break; - } -} #define MESG_SET_GPIO_PERMISSION_DENIED 86 #define MESG_GPIO_CTRL_QUEUE_IS_FULL 87 @@ -1827,12 +1787,10 @@ Strong UIImage *screenShotImage;//截图 if(rightItemCount==2){//NPC //无高清 if(i==0){ - //label.text = NSLocalizedString(@"SD", nil); label.text = NSLocalizedString(@"标清", nil); label.tag = CONTROLLER_LABEL_TAG_SD; button.tag = CONTROLLER_BTN_TAG_SD; }else if(i==1){ - //label.text = NSLocalizedString(@"LD", nil); label.text = NSLocalizedString(@"流畅", nil); label.tag = CONTROLLER_LABEL_TAG_LD; label.textColor = XBlue; @@ -2292,10 +2250,7 @@ Strong UIImage *screenShotImage;//截图 [self getLastImgGoback]; } - if(!_isReject){ - _isReject = YES; - [self.player p2pStop]; - } + [self.player p2pStop]; [Socketsingleton sharedInstance].communiteDelegate=nil; [[Socketsingleton sharedInstance] cutOffSocket]; [AppDelegate sharedDefault].canFullScreen = NO; @@ -2637,7 +2592,7 @@ Strong UIImage *screenShotImage;//截图 break; case CONTROLLER_BTN_TAG_LD: { - [self.player p2pSetDefinition:GWP2PPTZDefinitionLD]; + [self.player p2pSetDefinition:GWP2PPTZDefinitionLD];//流畅 [self updateRightButtonState:CONTROLLER_BTN_TAG_LD]; } break; @@ -2795,9 +2750,8 @@ Strong UIImage *screenShotImage;//截图 -(void)hiddenMonitoringUI:(BOOL)isHidden callWithErrorType:(GWP2PCallError)errorType isReCall:(BOOL)isReCall{ if (isHidden) { [self.yProgressView stop]; +// self.yProgressView.angle = 0.0f; [self.yProgressView setHidden:YES]; - - [self.promptButton setEnabled:NO]; [self.promptButton setHidden:YES]; @@ -2815,7 +2769,7 @@ Strong UIImage *screenShotImage;//截图 }else{ - self.yProgressView.angle = 0.0f; +// self.yProgressView.angle = 0.0f; self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start"); self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); [self.yProgressView stop]; @@ -3595,10 +3549,8 @@ GWP2PCallErrorNotSupport, //视频监控连接中的文字提示,以及旋转 //进入横屏时,调整frame self.promptButton.frame = self.canvasView.frame; - NSString *labelTipText = [NSString stringWithFormat:@"%@",NSLocalizedString(@"玩命加载中...", nil)]; - CGSize size = [labelTipText sizeWithFont:XFontBold_16]; //旋转图片 - CGFloat tipHeight = size.height + LOADINGPRESSVIEW_WIDTH_HEIGHT; + CGFloat tipHeight = LOADINGPRESSVIEW_WIDTH_HEIGHT; self.yProgressView.frame = CGRectMake((width-LOADINGPRESSVIEW_WIDTH_HEIGHT)/2, (height-tipHeight)/2, LOADINGPRESSVIEW_WIDTH_HEIGHT, LOADINGPRESSVIEW_WIDTH_HEIGHT); //进入横屏,修改remoteView的frame @@ -4517,7 +4469,6 @@ GWP2PCallErrorNotSupport, if (indexPath.row ==0) { //截图 [self screenShot]; -// [self.remoteView setIsScreenShotting:YES]; }else if (indexPath.row ==1){ //进入图库 if ([self.player isPlaying]) { @@ -4617,7 +4568,6 @@ GWP2PCallErrorNotSupport, -(void)pushkankanView{ - //IfishKanKanListViewController *kankanVc=[[IfishKanKanListViewController alloc] init]; LoveFishLiveListBaseViewController *kankanVc=[[LoveFishLiveListBaseViewController alloc] init]; [self.navigationController pushViewController:kankanVc animated:YES]; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm index b37654a..a45fdd6 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm @@ -348,9 +348,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { NSString *newPassword = GIWEI_INITPASS; self.lastSetPassword = [Utils GetTreatedPassword:newPassword];; - -// [[P2PClient sharedClient] setInitPasswordWithId:self.contactID initPassword:self.lastSetPassword]; - + }else{ } @@ -398,10 +396,12 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { NSString *deviceID = [deviceDict[@"deviceID"] stringValue]; NSString *deviceIP = deviceDict[@"deviceIP"]; + NSString *devicePassword = deviceDict[@"devicePassword"]; weakSelf.contactID = [NSString stringWithFormat:@"%d",deviceID]; if (![deviceDict[@"isInitPassword"] boolValue]) { //设备没有初始化密码,设置密码 [[GWP2PClient sharedClient] setDeviceInitialPassword:@"123" withDeviceID:deviceIP completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { NSLog(@"success:%i %@",success,dataDictionary); + [weakSelf.view makeToast:[NSString stringWithFormat:@"未初始化过设备密码,初始化设备密码失败 result = %i",dataDictionary]]; [weakSelf resetPassWord];//初始化密码 if (success) { [weakSelf initPwdResault:dataDictionary]; @@ -411,14 +411,15 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { weakSelf.lodviewMissStyle =lodingViewdissMissSuccsess; [weakSelf connectNormalView]; _canDissMissController = YES; - [weakSelf.view makeToast:NSLocalizedString(@"operator_failure", nil)]; +// [weakSelf.view makeToast:NSLocalizedString(@"operator_failure", nil)]; }); } }]; - } else { //设备已经初始化密码,可以让用户输入正确的密码验证通过后加到本地列表,这里直接使用123 - - [[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:deviceIP password:@"123" completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + } else { + //设备已经初始化过密码,则直接获取设备信息 + [[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:deviceIP password:devicePassword completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { NSLog(@"success:%i %@",success,dataDictionary); + [weakSelf.view makeToast:[NSString stringWithFormat:@"获取设备信息失败 result = %i",dataDictionary]]; [weakSelf resetPassWord];//更新密码 if (success) { dispatch_async(dispatch_get_main_queue(), ^{ @@ -438,7 +439,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { self.lodviewMissStyle =lodingViewdissMissSuccsess; [self connectNormalView]; _canDissMissController = YES; - [self.view makeToast:NSLocalizedString(@"operator_failure", nil)]; +// [self.view makeToast:NSLocalizedString(@"operator_failure", nil)]; }); } @@ -449,6 +450,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { //初始化设备密码回调 -(void)initPwdResault:(NSDictionary *)parameter{ + NSString * contactName = [NSString stringWithFormat:@"Cam%@", self.contactID]; ContactDAO *contactDAO = [[ContactDAO alloc] init]; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/ProgressImageView.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/ProgressImageView.m index 8878f31..bd24718 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/ProgressImageView.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/ProgressImageView.m @@ -56,7 +56,7 @@ self.isStartAnim = NO; //新家加 停止时img回复原始角度 dispatch_async(dispatch_get_main_queue(), ^{ - self.backgroundView.transform = CGAffineTransformMakeRotation(self.angle); + self.backgroundView.transform = CGAffineTransformIdentity; }); }