|
@@ -117,6 +117,7 @@ ComontAlretViewControllerDelegate>
|
|
ComontAlretViewController *linkFailAlretVC;
|
|
ComontAlretViewController *linkFailAlretVC;
|
|
|
|
|
|
NSTimer *forceStartTimer;//请知重启timer
|
|
NSTimer *forceStartTimer;//请知重启timer
|
|
|
|
+ BOOL isWebSockLinkOKAginType;//WebSock断开后或者链接上了
|
|
}
|
|
}
|
|
@property (nonatomic, strong, nullable) RCVideoRecoderManager *recoderManager;
|
|
@property (nonatomic, strong, nullable) RCVideoRecoderManager *recoderManager;
|
|
@property (nonatomic, strong, nullable) RCAudioRecoderMamager *audioRecoderMamager;
|
|
@property (nonatomic, strong, nullable) RCAudioRecoderMamager *audioRecoderMamager;
|
|
@@ -312,6 +313,10 @@ ComontAlretViewControllerDelegate>
|
|
}
|
|
}
|
|
|
|
|
|
- (void)viewWillDisappear:(BOOL)animated {
|
|
- (void)viewWillDisappear:(BOOL)animated {
|
|
|
|
+
|
|
|
|
+ //保存最后一帧
|
|
|
|
+ [self saveLastImageFun];
|
|
|
|
+
|
|
// 退出控制器 回收资源
|
|
// 退出控制器 回收资源
|
|
[self recyclResource];
|
|
[self recyclResource];
|
|
AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
@@ -584,7 +589,7 @@ ComontAlretViewControllerDelegate>
|
|
// if (self->deviceModel.authPhone==0 && self->deviceModel.phoneAuthStatus == 0){
|
|
// if (self->deviceModel.authPhone==0 && self->deviceModel.phoneAuthStatus == 0){
|
|
// return;/*自己的云手机且未授权直接返回*/
|
|
// return;/*自己的云手机且未授权直接返回*/
|
|
// }
|
|
// }
|
|
-//
|
|
|
|
|
|
+//
|
|
// if (![useName isEqualToString:selfUseName]){
|
|
// if (![useName isEqualToString:selfUseName]){
|
|
// /*根据实际情况进行相关回复*/
|
|
// /*根据实际情况进行相关回复*/
|
|
// [self.commandChannelManager rc_sendData:[RCCommandHelp faceBackControllcommandWithUseName:selfUseName haveControl:self->canControl]];
|
|
// [self.commandChannelManager rc_sendData:[RCCommandHelp faceBackControllcommandWithUseName:selfUseName haveControl:self->canControl]];
|
|
@@ -593,7 +598,7 @@ ComontAlretViewControllerDelegate>
|
|
// if (self->deviceModel.authPhone==0 && self->deviceModel.phoneAuthStatus == 0){
|
|
// if (self->deviceModel.authPhone==0 && self->deviceModel.phoneAuthStatus == 0){
|
|
// return;/*自己的云手机且未授权直接返回*/
|
|
// return;/*自己的云手机且未授权直接返回*/
|
|
// }
|
|
// }
|
|
-//
|
|
|
|
|
|
+//
|
|
// if (self->deviceModel.authPhone==0) {/*是自己的设备时候要询问是否夺回控制权*/
|
|
// if (self->deviceModel.authPhone==0) {/*是自己的设备时候要询问是否夺回控制权*/
|
|
// if (![useName isEqualToString:selfUseName]) {
|
|
// if (![useName isEqualToString:selfUseName]) {
|
|
// /*弹窗询问是否夺回控制权*/
|
|
// /*弹窗询问是否夺回控制权*/
|
|
@@ -616,11 +621,11 @@ ComontAlretViewControllerDelegate>
|
|
// if (self->deviceModel.authPhone==0 && self->deviceModel.phoneAuthStatus == 0){
|
|
// if (self->deviceModel.authPhone==0 && self->deviceModel.phoneAuthStatus == 0){
|
|
// return;/*自己的云手机且未授权直接返回*/
|
|
// return;/*自己的云手机且未授权直接返回*/
|
|
// }
|
|
// }
|
|
-//
|
|
|
|
|
|
+//
|
|
// if ([useName isEqualToString:selfUseName]){
|
|
// if ([useName isEqualToString:selfUseName]){
|
|
// return;
|
|
// return;
|
|
// }
|
|
// }
|
|
-//
|
|
|
|
|
|
+//
|
|
// if (self->deviceModel.authPhone!=0) {/*不是自己的设备时候要进行关闭控制权*/
|
|
// if (self->deviceModel.authPhone!=0) {/*不是自己的设备时候要进行关闭控制权*/
|
|
// if (self->canControl == YES) {
|
|
// if (self->canControl == YES) {
|
|
// /*弹窗提示控制权已经被夺回*/
|
|
// /*弹窗提示控制权已经被夺回*/
|
|
@@ -746,7 +751,9 @@ ComontAlretViewControllerDelegate>
|
|
[weakSelf stopForceStartTimerFun];
|
|
[weakSelf stopForceStartTimerFun];
|
|
}
|
|
}
|
|
} failure:^(NSError *error) {
|
|
} failure:^(NSError *error) {
|
|
|
|
+ self->isWebSockLinkOKAginType = NO;
|
|
[self showNetErrorAlertFun:2];
|
|
[self showNetErrorAlertFun:2];
|
|
|
|
+ [self WebSocketNeedRelinkFun];
|
|
}];
|
|
}];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -892,6 +899,8 @@ ComontAlretViewControllerDelegate>
|
|
{
|
|
{
|
|
[mPlayerView setPoMas_makeWithImageRate:ksharedAppDelegate.couldPhone_W_PHONE/ksharedAppDelegate.couldPhone_H_PHONE isOpenVirtual:YES isUsageMode:NO];
|
|
[mPlayerView setPoMas_makeWithImageRate:ksharedAppDelegate.couldPhone_W_PHONE/ksharedAppDelegate.couldPhone_H_PHONE isOpenVirtual:YES isUsageMode:NO];
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ [self readLastImageFun];
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1378,6 +1387,8 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
// 连接
|
|
// 连接
|
|
- (void)connectVideoServer {
|
|
- (void)connectVideoServer {
|
|
|
|
|
|
|
|
+ internetVideoPort = [[connectDeviceManager shareInstance] tcpPortStr];
|
|
|
|
+
|
|
if(self.didRecyclResource){
|
|
if(self.didRecyclResource){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -1400,7 +1411,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
NSString *tempIP = ip;
|
|
NSString *tempIP = ip;
|
|
|
|
|
|
HLog(@"__连接ip__%@,端口__%@",ip,internetVideoPort);
|
|
HLog(@"__连接ip__%@,端口__%@",ip,internetVideoPort);
|
|
-
|
|
|
|
|
|
+ [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"link ip %@,port %@",ip,internetVideoPort]];
|
|
//
|
|
//
|
|
RCCloudPhoneConnectType ConnectType = RCCloudPhoneConnectType_websocket;
|
|
RCCloudPhoneConnectType ConnectType = RCCloudPhoneConnectType_websocket;
|
|
RCCloudPhoneVideoQuality VideoQuality = RCCloudPhoneVideoQuality_Default;//RCCloudPhoneVideoQuality_High;
|
|
RCCloudPhoneVideoQuality VideoQuality = RCCloudPhoneVideoQuality_Default;//RCCloudPhoneVideoQuality_High;
|
|
@@ -1621,6 +1632,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
#pragma mark 盒子链接成功后需要处理的各种各样事情
|
|
#pragma mark 盒子链接成功后需要处理的各种各样事情
|
|
- (void)handlAllMsgAfterDidLinkFun
|
|
- (void)handlAllMsgAfterDidLinkFun
|
|
{
|
|
{
|
|
|
|
+ self->isWebSockLinkOKAginType = YES;
|
|
//获取云机尺寸 兼容 720*1080 &1080*1920 不同分辨率的展示和触控
|
|
//获取云机尺寸 兼容 720*1080 &1080*1920 不同分辨率的展示和触控
|
|
NSString *getPhoneSizeStr = [RCCommandHelp getPhoneSizecommand];
|
|
NSString *getPhoneSizeStr = [RCCommandHelp getPhoneSizecommand];
|
|
[self send_data:getPhoneSizeStr];
|
|
[self send_data:getPhoneSizeStr];
|
|
@@ -2082,7 +2094,12 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
#pragma mark 网络异常弹框
|
|
#pragma mark 网络异常弹框
|
|
-(void)showNetErrorAlertFun:(NSInteger)type
|
|
-(void)showNetErrorAlertFun:(NSInteger)type
|
|
{
|
|
{
|
|
- if(linkFailAlretVC){
|
|
|
|
|
|
+ [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"showNetErrorAlertFun %ld",type]];
|
|
|
|
+
|
|
|
|
+ if(linkFailAlretVC
|
|
|
|
+ ||[connectDeviceManager shareInstance].isReInitType//瑞云重新init 耗时2-7s 他们说的
|
|
|
|
+ ||(self->isWebSockLinkOKAginType && type == 2) //重连上了但是延时消息来了
|
|
|
|
+ ){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2130,6 +2147,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
okTitle:NSLocalizedString(@"player_link_fail_tryAgain",nil) isOkBtnHighlight:YES
|
|
okTitle:NSLocalizedString(@"player_link_fail_tryAgain",nil) isOkBtnHighlight:YES
|
|
didClickOk:^{
|
|
didClickOk:^{
|
|
[weakSelf tryAgainInLinkFailFun];
|
|
[weakSelf tryAgainInLinkFailFun];
|
|
|
|
+ [cachesFileManager writeLogsWithMsg:@"click tryAgain"];
|
|
|
|
|
|
} didClickCancel:^{
|
|
} didClickCancel:^{
|
|
exit(0);
|
|
exit(0);
|
|
@@ -2160,6 +2178,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ [[connectDeviceManager shareInstance] tryReconnectFun];
|
|
[self showNewIndicator];
|
|
[self showNewIndicator];
|
|
reConnectAccount = 0;
|
|
reConnectAccount = 0;
|
|
[self tryAgain];
|
|
[self tryAgain];
|