|
|
@@ -20,6 +20,8 @@
|
|
|
@interface cloudPhoneViewController ()
|
|
|
@property (nonatomic,strong) cloudPhoneSetView *cloudPhoneSetV;
|
|
|
@property (nonatomic,strong) webRtcMsgModel *webRtcMsgMod;
|
|
|
+
|
|
|
+@property (nonatomic,strong) webRtcPlayerViewController *preLinkWebRtcPlayerVC;//做预连接处理
|
|
|
@end
|
|
|
|
|
|
@implementation cloudPhoneViewController
|
|
|
@@ -31,6 +33,8 @@
|
|
|
//输入密码完成
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didInpuPwdOkFun) name:didInputPWDNotification object:nil];
|
|
|
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(preLinkCloudPhoneFun) name:preLinkCloudPhoneNotification object:nil];
|
|
|
+
|
|
|
[self.view setBackgroundColor:HWF5F7FAColor];
|
|
|
|
|
|
[self.toolBar setHidden:YES];
|
|
|
@@ -39,6 +43,7 @@
|
|
|
|
|
|
[self drawAnyView];
|
|
|
|
|
|
+ [self queryWebRtcMsgFun:YES withPreLinkType:YES];
|
|
|
}
|
|
|
|
|
|
- (void)drawAnyView{
|
|
|
@@ -255,7 +260,7 @@
|
|
|
// [[iToast makeText:NSLocalizedString(@"tv_p2p_ing",nil)] show];
|
|
|
// }
|
|
|
|
|
|
- [self queryWebRtcMsgFun:YES];
|
|
|
+ [self queryWebRtcMsgFun:YES withPreLinkType:NO];
|
|
|
|
|
|
//数据埋点
|
|
|
[[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Cloud_enter"];
|
|
|
@@ -533,16 +538,18 @@
|
|
|
|
|
|
|
|
|
#pragma mark 获取webrct 的链接信息
|
|
|
--(void)queryWebRtcMsgFun:(BOOL)isPlayerType
|
|
|
+-(void)queryWebRtcMsgFun:(BOOL)isPlayerType withPreLinkType:(BOOL)isPreLinkType
|
|
|
{
|
|
|
if(isPlayerType){
|
|
|
|
|
|
if(ksharedAppDelegate.DeviceWebRtcMsgMod && ksharedAppDelegate.DeviceWebRtcMsgMod.data.sn){
|
|
|
- [self gotoWebRtcVcBy:ksharedAppDelegate.DeviceWebRtcMsgMod];
|
|
|
+ [self gotoWebRtcVcBy:ksharedAppDelegate.DeviceWebRtcMsgMod withPreLinkType:isPreLinkType];
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- [self showNewIndicatorWithCanBack:YES canTouch:NO];
|
|
|
+ if (!isPreLinkType) {
|
|
|
+ [self showNewIndicatorWithCanBack:YES canTouch:NO];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
NSMutableDictionary *paraDict = [NSMutableDictionary new];
|
|
|
@@ -551,7 +558,9 @@
|
|
|
[[netWorkManager shareInstance] CommonPostCallBackCode:webrctQueryByClient Parameters:paraDict success:^(id _Nonnull responseObject){
|
|
|
|
|
|
if(isPlayerType){
|
|
|
- [weakSelf removeNewIndicator];
|
|
|
+ if (!isPreLinkType){
|
|
|
+ [weakSelf removeNewIndicator];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
webRtcMsgModel *curModel = [[webRtcMsgModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
@@ -559,7 +568,7 @@
|
|
|
if(curModel && curModel.status == 0){
|
|
|
ksharedAppDelegate.DeviceWebRtcMsgMod = curModel;
|
|
|
if(isPlayerType){
|
|
|
- [weakSelf gotoWebRtcVcBy:curModel];
|
|
|
+ [weakSelf gotoWebRtcVcBy:curModel withPreLinkType:isPreLinkType];
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -571,14 +580,16 @@
|
|
|
|
|
|
} failure:^(NSError * _Nonnull error) {
|
|
|
if(isPlayerType){
|
|
|
- [weakSelf removeNewIndicator];
|
|
|
- [[iToast makeText:NSLocalizedString(@"get_webrtcMsg_fail_tip",nil)] show];
|
|
|
+ if (!isPreLinkType){
|
|
|
+ [weakSelf removeNewIndicator];
|
|
|
+ [[iToast makeText:NSLocalizedString(@"get_webrtcMsg_fail_tip",nil)] show];
|
|
|
+ }
|
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
#pragma mark 跳转webrtc 页面
|
|
|
-- (void)gotoWebRtcVcBy:(webRtcMsgModel*)webRtcMsgMod
|
|
|
+- (void)gotoWebRtcVcBy:(webRtcMsgModel*)webRtcMsgMod withPreLinkType:(BOOL)isPreLinkType
|
|
|
{
|
|
|
|
|
|
NSArray * vcArrs = self.navigationController.viewControllers;
|
|
|
@@ -587,9 +598,15 @@
|
|
|
}
|
|
|
[cachesFileManager writeLogsWithMsg:@"webRtcPlayer push webRtcPlayerVC"];
|
|
|
|
|
|
- webRtcPlayerViewController *vc = [webRtcPlayerViewController new];
|
|
|
- vc.webRtcMsgMod = webRtcMsgMod;
|
|
|
- [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ if(!_preLinkWebRtcPlayerVC){
|
|
|
+ _preLinkWebRtcPlayerVC = [webRtcPlayerViewController new];
|
|
|
+ _preLinkWebRtcPlayerVC.webRtcMsgMod = webRtcMsgMod;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!isPreLinkType) {
|
|
|
+ [_preLinkWebRtcPlayerVC setPrelinkPlay];
|
|
|
+ [self.navigationController pushViewController:_preLinkWebRtcPlayerVC animated:YES];
|
|
|
+ }
|
|
|
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
ksharedAppDelegate.isCloudPhoneModeNotPrivacyModeOpenType = NO;
|
|
|
@@ -605,7 +622,7 @@
|
|
|
mainBlock(^{
|
|
|
if(ksharedAppDelegate.isCloudPhoneModeAndPrivacyModeOpenType
|
|
|
|| ksharedAppDelegate.needToPushWebRtcVCType){
|
|
|
- [weakSelf queryWebRtcMsgFun:YES];
|
|
|
+ [weakSelf queryWebRtcMsgFun:YES withPreLinkType:NO];
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -616,4 +633,22 @@
|
|
|
NasPreviewAPPViewController *vc = [NasPreviewAPPViewController new];
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+#pragma mark 开始预链接
|
|
|
+- (void)preLinkCloudPhoneFun
|
|
|
+{
|
|
|
+ if(_preLinkWebRtcPlayerVC){
|
|
|
+ [_preLinkWebRtcPlayerVC exitCloudPhoneFun:NO];
|
|
|
+ _preLinkWebRtcPlayerVC = nil;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ [self queryWebRtcMsgFun:YES withPreLinkType:YES];
|
|
|
+
|
|
|
+// if(ksharedAppDelegate.DeviceWebRtcMsgMod){
|
|
|
+// _preLinkWebRtcPlayerVC = [webRtcPlayerViewController new];
|
|
|
+// _preLinkWebRtcPlayerVC.webRtcMsgMod = ksharedAppDelegate.DeviceWebRtcMsgMod;
|
|
|
+// }
|
|
|
+}
|
|
|
@end
|