|
@@ -114,6 +114,8 @@ ComontAlretViewControllerDelegate>
|
|
|
|
|
|
/*弹窗提示重启*/
|
|
|
ComontAlretViewController *logoutAlertVC;
|
|
|
+ /*弹窗提示链接失败 网络或者云机*/
|
|
|
+ ComontAlretViewController *linkFailAlretVC;
|
|
|
}
|
|
|
@property (nonatomic, strong, nullable) RCVideoRecoderManager *recoderManager;
|
|
|
@property (nonatomic, strong, nullable) RCAudioRecoderMamager *audioRecoderMamager;
|
|
@@ -140,6 +142,7 @@ ComontAlretViewControllerDelegate>
|
|
|
@property (nonatomic, assign) BOOL isFirstEnterPhone;
|
|
|
|
|
|
@property (nonatomic, strong) NSTimer *checkThridConnectTimer; // 检查瑞云那边连接完成没
|
|
|
+@property (nonatomic, assign) NSInteger checkThridConnectNum;//
|
|
|
|
|
|
//音频和图片是否可以刷新
|
|
|
@property (nonatomic, assign) BOOL canShowImgAndVoiceType;
|
|
@@ -203,7 +206,7 @@ ComontAlretViewControllerDelegate>
|
|
|
mySelf = self;
|
|
|
haveBack = NO;
|
|
|
|
|
|
- _checkThridConnectTimer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(checkThridRuiYunFun) userInfo:nil repeats:YES];
|
|
|
+ _checkThridConnectTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(checkThridRuiYunFun) userInfo:nil repeats:YES];
|
|
|
[[NSRunLoop currentRunLoop] addTimer:_checkThridConnectTimer forMode:NSRunLoopCommonModes];
|
|
|
}
|
|
|
|
|
@@ -211,6 +214,15 @@ ComontAlretViewControllerDelegate>
|
|
|
#pragma mark 检测融云链接是否完成
|
|
|
- (void)checkThridRuiYunFun{
|
|
|
|
|
|
+ _checkThridConnectNum += 1;
|
|
|
+
|
|
|
+ if(_checkThridConnectNum == 60 && [[connectDeviceManager shareInstance] curConnectDeviceState] <= 3 ){
|
|
|
+ [self showNetErrorAlertFun];
|
|
|
+
|
|
|
+// [_checkThridConnectTimer invalidate];
|
|
|
+// return;
|
|
|
+ }
|
|
|
+
|
|
|
//HLog(@"局域网是否能ping通:%d",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPingOk);
|
|
|
HLog(@"瑞云连接状态:%d",[[connectDeviceManager shareInstance] curConnectDeviceState]);
|
|
|
|
|
@@ -465,7 +477,7 @@ ComontAlretViewControllerDelegate>
|
|
|
NSString *messageType = dataDict[@"type"];
|
|
|
|
|
|
if ([messageType isEqualToString:@"cutting"]) {
|
|
|
- [[iToast makeText:@"复制成功"] show];
|
|
|
+ //[[iToast makeText:@"复制成功"] show];
|
|
|
}
|
|
|
else if ([messageType isEqualToString:@"forwardMsg"]){/*转发*/
|
|
|
/*获取指令类型*/
|
|
@@ -621,7 +633,7 @@ ComontAlretViewControllerDelegate>
|
|
|
}
|
|
|
else if ([messageType isEqualToString:@"sync_wifi"]){
|
|
|
[self.commandChannelManager rc_sendData:[RCCommandHelp noSyncWifiBack]];
|
|
|
- [[iToast makeText:@"本机参数已同步完成,IOS无法同步wifi"] show];
|
|
|
+ //[[iToast makeText:@"本机参数已同步完成,IOS无法同步wifi"] show];
|
|
|
}
|
|
|
else if ([messageType isEqualToString:@"reProduceText"]){
|
|
|
NSString *sn = nil;
|
|
@@ -643,11 +655,11 @@ ComontAlretViewControllerDelegate>
|
|
|
NSString *status = [data objectForKey:@"status"];
|
|
|
if ([status isEqualToString:@"1"]) {
|
|
|
mainBlock(^{
|
|
|
- [[iToast makeText:@"App下载完成"] show];
|
|
|
+ // [[iToast makeText:@"App下载完成"] show];
|
|
|
});
|
|
|
}else if ([status isEqualToString:@"0"]){
|
|
|
mainBlock(^{
|
|
|
- [[iToast makeText:@"App下载中"] show];
|
|
|
+ //[[iToast makeText:@"App下载中"] show];
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -1142,6 +1154,14 @@ ComontAlretViewControllerDelegate>
|
|
|
if (self.isFirstEnterPhone) {
|
|
|
self.isFirstEnterPhone = NO;
|
|
|
}
|
|
|
+
|
|
|
+ // 报链接失败 后面又连接上了
|
|
|
+ if(linkFailAlretVC){
|
|
|
+ [linkFailAlretVC dismissViewControllerAnimated:YES completion:^{
|
|
|
+
|
|
|
+ }];
|
|
|
+ linkFailAlretVC = nil;
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
case 3:/*正在渲染*/{
|
|
@@ -1411,7 +1431,8 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
}
|
|
|
else if (result == 12)
|
|
|
{
|
|
|
- [[iToast makeText:@"画面异常,请重新进入"] show];
|
|
|
+ //[[iToast makeText:@"画面异常,请重新进入"] show];
|
|
|
+ HLog(@"画面异常,请重新进入");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1642,7 +1663,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#pragma mark 判断是否为密码界面登
|
|
|
+#pragma mark 判断是否为密码界面登 函数意思写反了 ~~~~
|
|
|
- (BOOL)isPlayerViewIsTopVCFun
|
|
|
{
|
|
|
UIViewController*topVc = self.navigationController.viewControllers.lastObject;
|
|
@@ -1812,12 +1833,14 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
break;
|
|
|
case AFNetworkReachabilityStatusNotReachable:/*网络不可用*/
|
|
|
{
|
|
|
- [[iToast makeText:@"网络异常,请稍后重试!"] show];
|
|
|
+ //[[iToast makeText:@"网络异常,请稍后重试!"] show];
|
|
|
|
|
|
// if (_ihandle > 0)
|
|
|
// {
|
|
|
[self disconnectVideoServer];
|
|
|
// }
|
|
|
+
|
|
|
+ [self showNetErrorAlertFun];
|
|
|
}
|
|
|
break;
|
|
|
case AFNetworkReachabilityStatusReachableViaWWAN:/*流量*/
|
|
@@ -1843,13 +1866,56 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
|
|
|
}
|
|
|
|
|
|
+#pragma mark 网络异常弹框
|
|
|
+-(void)showNetErrorAlertFun
|
|
|
+{
|
|
|
+ if(linkFailAlretVC){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if([self isPlayerViewIsTopVCFun]){
|
|
|
+ //等下再发
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
+ [self showNetErrorAlertFun];
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString *linkErrTip = NSLocalizedString(@"player_link_fail_couldPhone_Tips",nil);
|
|
|
+ if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable){
|
|
|
+ linkErrTip = NSLocalizedString(@"player_link_fail_phone_Tips",nil);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"player_link_fail_title",nil)
|
|
|
+ msg:linkErrTip
|
|
|
+ cancelTitle:NSLocalizedString(@"single_sign_on_exit",nil)
|
|
|
+ okTitle:NSLocalizedString(@"player_link_fail_tryAgain",nil) isOkBtnHighlight:YES
|
|
|
+ didClickOk:^{
|
|
|
+ [self showNewIndicator];
|
|
|
+ self->reConnectAccount = 0;
|
|
|
+ [self tryAgain];
|
|
|
+
|
|
|
+ self->linkFailAlretVC = nil;
|
|
|
+
|
|
|
+ } didClickCancel:^{
|
|
|
+ exit(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ linkFailAlretVC.modalPresentationStyle = UIModalPresentationCustom;
|
|
|
+
|
|
|
+ [self presentViewController:linkFailAlretVC animated:YES completion:^{
|
|
|
+ self->linkFailAlretVC.view.superview.backgroundColor = [UIColor clearColor];
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
BOOL inReconnect = NO;
|
|
|
- (void)tryAgain
|
|
|
{
|
|
|
reConnectAccount++;
|
|
|
|
|
|
//20231017 修改后台3分钟再次进入 不断转圈圈问题
|
|
|
- if (reConnectAccount >0 && (reConnectAccount%10) == 0 )
|
|
|
+ if (reConnectAccount >0 && reConnectAccount == 10 )
|
|
|
{
|
|
|
mainBlock(^{
|
|
|
|
|
@@ -1860,7 +1926,11 @@ BOOL inReconnect = NO;
|
|
|
|
|
|
/*链接失败*/
|
|
|
|
|
|
- [[iToast makeText:@"云手机连接超时,请稍后再试!"] show];
|
|
|
+ [[iToast makeText:NSLocalizedString(@"player_link_fail_tip",nil)] show];
|
|
|
+
|
|
|
+ HLog(@"yyyyyyyyyyyyy");
|
|
|
+
|
|
|
+ [self showNetErrorAlertFun];
|
|
|
});
|
|
|
|
|
|
return;
|
|
@@ -2498,11 +2568,9 @@ static int couneeee = 0;
|
|
|
if (self.concentTime == 0) { //云手机未连接成功
|
|
|
HLog(@"云手机未连接成功");
|
|
|
}else if (timeDiff >= 30) { // 30s 无渲染数据
|
|
|
- HLog(@"云手机30s 无渲染数据 自动断开连接");
|
|
|
|
|
|
if(!_isLoginAgainType && [self isPlayerViewIsTopVCFun]){
|
|
|
- //[[iToast makeText:@"云手机连接超时,请稍后再试!"] show];
|
|
|
-
|
|
|
+ HLog(@"云手机30s 无渲染数据 自动断开连接");
|
|
|
self.concentTime = [iTools getNowTimeStamp];
|
|
|
|
|
|
[self showNewIndicator];
|