cloudPhoneViewController.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. //
  2. // cloudPhoneViewController.m
  3. // Private-X
  4. //
  5. // Created by xd h on 2024/6/20.
  6. //
  7. #import "cloudPhoneViewController.h"
  8. #import "cloudPhoneSetView.h"
  9. #import "audioPlayingView.h"
  10. #import "DFPlayer.h"
  11. #import "audioPlayerViewController.h"
  12. #import "webRtcMsgModel.h"
  13. #import "webRtcPlayerViewController.h"
  14. #import "customRestartingBoxView.h"
  15. #import "NasPreviewAPPViewController.h"
  16. @interface cloudPhoneViewController ()
  17. @property (nonatomic,strong) cloudPhoneSetView *cloudPhoneSetV;
  18. @property (nonatomic,strong) webRtcMsgModel *webRtcMsgMod;
  19. @end
  20. @implementation cloudPhoneViewController
  21. - (void)viewDidLoad {
  22. [super viewDidLoad];
  23. // Do any additional setup after loading the view.
  24. //输入密码完成
  25. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didInpuPwdOkFun) name:didInputPWDNotification object:nil];
  26. [self.view setBackgroundColor:HWF5F7FAColor];
  27. [self.toolBar setHidden:YES];
  28. [self.navigationBar setHidden:YES];
  29. [self.navBarBGView setHidden:YES];
  30. [self drawAnyView];
  31. }
  32. - (void)drawAnyView{
  33. //顶底底部图片
  34. UIImageView *topImageV = [UIImageView new];
  35. topImageV.userInteractionEnabled = YES;
  36. topImageV.image = [UIImage imageNamed:@"cloudPhone_bg"];
  37. [self.view addSubview:topImageV];
  38. [topImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.top.mas_equalTo(0);
  40. make.left.mas_equalTo(0);
  41. make.right.mas_equalTo(0);
  42. make.bottom.mas_equalTo(0);
  43. }];
  44. CGFloat width = SCREEN_W;
  45. CGFloat height = SCREEN_H;
  46. BOOL isSmallPhoneType = NO;
  47. if(width == 375 && height == 667){
  48. isSmallPhoneType = YES;
  49. }
  50. CGFloat adjustSmallScale = 1.0;
  51. if(isSmallPhoneType){
  52. adjustSmallScale = 0.9;
  53. }
  54. CGFloat imageTopY = 54.0;
  55. if(isSmallPhoneType){
  56. imageTopY = 20.0;
  57. }
  58. //设置按钮
  59. UIButton *setButton = [[UIButton alloc] init];
  60. //[setButton setBackgroundImage:[UIImage imageNamed:@"cloudPhone_set"] forState:UIControlStateNormal];
  61. [setButton setImage:[UIImage imageNamed:@"cloudPhone_set"] forState:UIControlStateNormal];
  62. setButton.tag = 1;
  63. [setButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  64. [self.view addSubview:setButton];
  65. //setButton.backgroundColor = [UIColor greenColor];
  66. [setButton mas_makeConstraints:^(MASConstraintMaker *make) {
  67. make.top.mas_equalTo(imageTopY);
  68. if(isSmallPhoneType){
  69. make.right.mas_equalTo(-5);
  70. }
  71. else{
  72. make.right.mas_equalTo(-16);
  73. }
  74. make.width.mas_equalTo(50);
  75. make.height.mas_equalTo(50);
  76. // make.top.mas_equalTo(imageTopY);
  77. // make.right.mas_equalTo(-16);
  78. // make.width.mas_equalTo(24);
  79. // make.height.mas_equalTo(24);
  80. }];
  81. //中间图片
  82. UIImageView *midImageV = [UIImageView new];
  83. midImageV.userInteractionEnabled = YES;
  84. midImageV.image = [UIImage imageNamed:@"cloudPhone_mid_img"];
  85. [self.view addSubview:midImageV];
  86. [midImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  87. make.width.mas_equalTo(326*WAUTOSCALE*adjustSmallScale);
  88. make.height.mas_equalTo(608*WAUTOSCALE*adjustSmallScale);
  89. make.centerX.mas_equalTo(0);
  90. make.centerY.mas_equalTo(-10);
  91. }];
  92. NSString *midTopTipImageStr = @"cloudPhone_topTip_img_cs";
  93. //欢迎
  94. //en-US 英文 ja-JP 日文
  95. NSArray *arLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
  96. NSLog(@"arLanguages:%@",arLanguages);
  97. ///获取设备当前地区的代码和APP语言环境
  98. NSString *languageCode = [NSLocale preferredLanguages][0];
  99. //目前支持 中文(简体 繁体) 英文 日语
  100. if([languageCode rangeOfString:@"zh-Hans"].location != NSNotFound)
  101. {
  102. midTopTipImageStr = @"cloudPhone_topTip_img_cs";
  103. }
  104. else if([languageCode rangeOfString:@"zh-Hant"].location != NSNotFound)
  105. {
  106. midTopTipImageStr = @"cloudPhone_topTip_img_ct";
  107. }
  108. else{
  109. midTopTipImageStr = @"cloudPhone_topTip_img_en";
  110. }
  111. //提示文字图片
  112. UIImageView *midTopTipImageV = [UIImageView new];
  113. midTopTipImageV.image = [UIImage imageNamed:midTopTipImageStr];
  114. [midImageV addSubview:midTopTipImageV];
  115. [midTopTipImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  116. make.width.mas_equalTo(282*WAUTOSCALE*adjustSmallScale);
  117. make.height.mas_equalTo(84*WAUTOSCALE*adjustSmallScale);
  118. make.centerX.mas_equalTo(0);
  119. make.top.equalTo(midImageV.mas_top).offset(64);
  120. }];
  121. //进入云机
  122. UIButton*enterCloudPhoneButton = [[UIButton alloc] init];
  123. CGFloat w_btn = SCREEN_W - 15*2 - 50*2;
  124. // gradient
  125. CAGradientLayer *gl = [CAGradientLayer layer];
  126. gl.frame = CGRectMake(0,0,w_btn,44.f);
  127. gl.startPoint = CGPointMake(0, 0.5);
  128. gl.endPoint = CGPointMake(0.97, 0.5);
  129. gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
  130. gl.locations = @[@(0), @(1.0f)];
  131. [enterCloudPhoneButton.layer addSublayer:gl];
  132. [enterCloudPhoneButton setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
  133. //[enterCloudPhoneButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:(UIControlEventTouchUpInside)];
  134. [enterCloudPhoneButton setTitle:NSLocalizedString(@"cloudPhone_enter_tip",nil) forState:(UIControlStateNormal)];
  135. [enterCloudPhoneButton.titleLabel setFont:[UIFont systemFontOfSize:16.f]];
  136. [enterCloudPhoneButton.layer setCornerRadius:21.f];
  137. enterCloudPhoneButton.layer.borderWidth = 1.5;
  138. enterCloudPhoneButton.layer.borderColor = [UIColor whiteColor].CGColor;
  139. enterCloudPhoneButton.clipsToBounds = YES;
  140. //enterCloudPhoneButton.tag = 2;
  141. [midImageV addSubview:enterCloudPhoneButton];
  142. [enterCloudPhoneButton mas_makeConstraints:^(MASConstraintMaker *make) {
  143. make.width.mas_equalTo(w_btn);
  144. make.height.mas_equalTo(42);
  145. make.centerX.mas_equalTo(0);
  146. make.bottom.equalTo(midImageV.mas_bottom).offset(-60);
  147. }];
  148. //扩大金融云机范围按钮
  149. UIButton *bigButton = [[UIButton alloc] init];
  150. bigButton.tag = 2;
  151. [bigButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  152. [self.view addSubview:bigButton];
  153. //bigButton.backgroundColor = [UIColor greenColor];
  154. [bigButton mas_makeConstraints:^(MASConstraintMaker *make) {
  155. make.top.equalTo(midImageV.mas_top).offset(0);
  156. make.right.equalTo(midImageV.mas_right).offset(0);
  157. make.left.equalTo(midImageV.mas_left).offset(0);
  158. make.bottom.equalTo(midImageV.mas_bottom).offset(0);
  159. }];
  160. }
  161. #pragma mark 点击按钮
  162. - (void)didClickButtonFun:(UIButton*)but
  163. {
  164. if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
  165. {
  166. [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
  167. return;
  168. }
  169. // if (!ksharedAppDelegate.isWebSockLinkOKAginType) {//未链接
  170. // [[iToast makeText:NSLocalizedString(@"box_link_error_show_tip",nil)] show];
  171. // return;
  172. // }
  173. NSInteger tag = but.tag;
  174. HLog(@"%ld",tag);
  175. switch (tag) {
  176. case 1:
  177. {
  178. //数据埋点
  179. [[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Cloud_settings"];
  180. _cloudPhoneSetV = [cloudPhoneSetView new];
  181. [ksharedAppDelegate.window addSubview:_cloudPhoneSetV];
  182. [_cloudPhoneSetV mas_makeConstraints:^(MASConstraintMaker *make) {
  183. make.left.mas_equalTo(0);
  184. make.right.mas_equalTo(0);
  185. make.top.mas_equalTo(0);
  186. make.bottom.mas_equalTo(0);
  187. }];
  188. KWeakSelf
  189. _cloudPhoneSetV.didClickButtonFun = ^(NSInteger tag) {
  190. if (tag == 10) {//应用上传
  191. [weakSelf gotoAPPVCFun];
  192. }
  193. else if (tag == 11){//重启
  194. [weakSelf didClickRestartFun];
  195. }
  196. else if (tag == 12){//恢复出厂
  197. [weakSelf RestoreFactoryAleartFun];
  198. }
  199. else if (tag == 13){//重启盒子
  200. [weakSelf didClickRestartBoxFun];
  201. }
  202. };
  203. }
  204. break;
  205. case 2:
  206. {
  207. //[self checkFullScreenWithTVShowStateFun];
  208. // PlayerViewController *vc = [PlayerViewController new];
  209. // [self pushViewController:vc animated:YES];
  210. //
  211. // if(ksharedAppDelegate.TvStatusMod.isTVShowType){
  212. // [[iToast makeText:NSLocalizedString(@"tv_p2p_ing",nil)] show];
  213. // }
  214. [self queryWebRtcMsgFun:YES];
  215. //数据埋点
  216. [[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Cloud_enter"];
  217. }
  218. break;
  219. default:
  220. break;
  221. }
  222. }
  223. #pragma mark 点击了重启空间
  224. - (void)didClickRestartFun
  225. {
  226. KWeakSelf
  227. /*弹窗提示重启*/
  228. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_restart_phone_tips",nil)
  229. msg:@""
  230. imageStr:@""
  231. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  232. okTitle:NSLocalizedString(@"my_set_no_restart_phone_btn_ok",nil) isOkBtnHighlight:NO
  233. didClickOk:^{
  234. [weakSelf sureToRestartCloudPhoneFun];
  235. } didClickCancel:^{
  236. }];
  237. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  238. [self presentViewController:nextVC animated:YES completion:^{
  239. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  240. }];
  241. }
  242. #pragma mark 确认重启云机
  243. - (void)sureToRestartCloudPhoneFun{
  244. // /*重启云手机*/
  245. // 通过指令通道发送 {"type":"reboot"}
  246. [[webRtcManager shareManager] needToRebootFun];
  247. //提示语
  248. [[iToast makeText:NSLocalizedString(@"player_link_rebooting_Tips",nil)] show];
  249. }
  250. #pragma mark 点击恢复出厂
  251. - (void)RestoreFactoryAleartFun
  252. {
  253. KWeakSelf
  254. /*弹窗提示恢复出厂*/
  255. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_Restore_Factory_tips",nil)
  256. msg:NSLocalizedString(@"my_set_no_Restore_Factory_msg",nil)
  257. imageStr:@"icon_Restore_Factory_big"
  258. cancelTitle:NSLocalizedString(@"my_set_TVP2P_Open_sure",nil)
  259. okTitle:NSLocalizedString(@"other_cancel",nil) isOkBtnHighlight:YES
  260. didClickOk:^{
  261. } didClickCancel:^{
  262. //点击确定
  263. [weakSelf gotoResetFun];
  264. }];
  265. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  266. [self presentViewController:nextVC animated:YES completion:^{
  267. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  268. }];
  269. }
  270. #pragma mark 点击了恢复出厂
  271. - (void)gotoResetFun
  272. {
  273. [[webRtcManager shareManager] needToResetFun];
  274. [self RestoreFactoryingFun];
  275. }
  276. #pragma mark 恢复出厂中
  277. - (void)RestoreFactoryingFun
  278. {
  279. KWeakSelf
  280. /*弹窗提示恢复出厂*/
  281. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_Restore_Factorying_tips",nil)
  282. msg:NSLocalizedString(@"my_set_no_Restore_Factorying_msg",nil)
  283. imageStr:@""
  284. cancelTitle:NSLocalizedString(@"my_set_no_Restore_Factorying",nil)
  285. okTitle:@""
  286. isOkBtnHighlight:NO
  287. didClickOk:^{
  288. [weakSelf RestoreFactoryCompleteFun];
  289. } didClickCancel:^{
  290. }];
  291. [nextVC setButtonCountdownFun:180];//90
  292. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  293. [self presentViewController:nextVC animated:YES completion:^{
  294. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  295. }];
  296. }
  297. #pragma mark 恢复出厂倒计时结束
  298. - (void)RestoreFactoryCompleteFun
  299. {
  300. //KWeakSelf
  301. //瑞云发起重连
  302. //[[connectDeviceManager shareInstance] onConnectFun];
  303. /*弹窗提示恢复出厂*/
  304. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_Restore_Factory_ok_tips",nil)
  305. msg:@""
  306. imageStr:@""
  307. cancelTitle:NSLocalizedString(@"my_set_no_Restore_FactoryOK",nil)
  308. okTitle:@""
  309. isOkBtnHighlight:NO
  310. didClickOk:^{
  311. } didClickCancel:^{
  312. }];
  313. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  314. [self presentViewController:nextVC animated:YES completion:^{
  315. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  316. }];
  317. }
  318. #pragma mark 点击重启盒子
  319. - (void)didClickRestartBoxFun
  320. {
  321. KWeakSelf
  322. /*弹窗提示恢复出厂*/
  323. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"cloudPhone_restart_box_tip",nil)
  324. msg:NSLocalizedString(@"cloudPhone_restart_box_msg",nil)
  325. imageStr:@""
  326. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  327. okTitle:NSLocalizedString(@"my_set_TVP2P_Open_sure",nil) isOkBtnHighlight:YES
  328. didClickOk:^{
  329. //点击确定
  330. [weakSelf gotoRestartBoxFun];
  331. } didClickCancel:^{
  332. }];
  333. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  334. [self presentViewController:nextVC animated:YES completion:^{
  335. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  336. }];
  337. }
  338. #pragma mark 重启盒子
  339. - (void)gotoRestartBoxFun{
  340. NSString* curSn = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
  341. NSMutableDictionary *paraDict = [NSMutableDictionary dictionary];
  342. [paraDict setValue:curSn forKey:@"sn"];
  343. [paraDict setValue:[NSNumber numberWithBool:YES] forKey:@"restartBox"];
  344. KWeakSelf
  345. [[netWorkManager shareInstance] CommonPostCallBackCode:restartTheBox Parameters:paraDict success:^(id _Nonnull responseObject) {
  346. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  347. if (model && model.status == 0) {
  348. [weakSelf RestartBoxingFun];
  349. }
  350. else
  351. {
  352. }
  353. } failure:^(NSError * _Nonnull error) {
  354. }];
  355. }
  356. #pragma mark 重启盒子中
  357. - (void)RestartBoxingFun
  358. {
  359. [webRtcManager shareManager].isReRestartIngBoxType = YES;
  360. customRestartingBoxView *view = [[customRestartingBoxView alloc] init];
  361. [ksharedAppDelegate.window addSubview:view];
  362. [view mas_makeConstraints:^(MASConstraintMaker *make) {
  363. make.left.mas_equalTo(0.f);
  364. make.bottom.mas_equalTo(0.f);
  365. make.right.mas_equalTo(0.f);
  366. make.top.mas_equalTo(0.f);
  367. }];
  368. }
  369. #pragma mark 重启盒子成功
  370. - (void)viewWillAppear:(BOOL)animated{
  371. [super viewWillAppear:animated];
  372. [self handelAudioPlayingViewFun];
  373. }
  374. - (void)viewWillDisappear:(BOOL)animated{
  375. [super viewWillDisappear:animated];
  376. }
  377. - (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated
  378. {
  379. [self.navigationController pushViewController:vc animated:animated];
  380. }
  381. #pragma mark 处理音频播放中的视图状态
  382. - (void)handelAudioPlayingViewFun
  383. {
  384. audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
  385. if([DFPlayer sharedPlayer].state == DFPlayerStateBuffering
  386. ||[DFPlayer sharedPlayer].state == DFPlayerStatePlaying
  387. ||[DFPlayer sharedPlayer].state == DFPlayerStatePause){//播放中
  388. [self showAudioPlayingViewFun];
  389. }
  390. else{
  391. [self hideAudioPlayingViewFun];
  392. }
  393. KWeakSelf
  394. audioPlayingV.didClickButtonFun = ^(NSInteger tag) {
  395. if(tag == 1){
  396. [weakSelf hideAudioPlayingViewFun];
  397. }
  398. else if(tag == 5){
  399. [weakSelf AudioPlayingGotoAudioPlayerVCFun];
  400. }
  401. };
  402. }
  403. - (void)AudioPlayingGotoAudioPlayerVCFun{
  404. audioPlayerViewController *vc = [audioPlayerViewController new];
  405. vc.isfirstEnterType = NO;
  406. [self.navigationController pushViewController:vc animated:YES];
  407. }
  408. #pragma mark 显示音频播放中的视图
  409. - (void)showAudioPlayingViewFun
  410. {
  411. audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
  412. [self.view addSubview:audioPlayingV];
  413. if([DFPlayer sharedPlayer].state == DFPlayerStatePlaying){
  414. [audioPlayingV startRotatingImage];
  415. }
  416. else if ([DFPlayer sharedPlayer].state == DFPlayerStatePause){
  417. [audioPlayingV stopRotatingImage];
  418. }
  419. [audioPlayingV mas_makeConstraints:^(MASConstraintMaker *make) {
  420. make.height.mas_equalTo(49);
  421. make.left.mas_equalTo(0);
  422. make.right.mas_equalTo(0);
  423. make.bottom.mas_equalTo(-TABBARHEIGHT);
  424. }];
  425. }
  426. #pragma mark 隐藏音频播放中的视图
  427. - (void)hideAudioPlayingViewFun
  428. {
  429. // audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
  430. // [audioPlayingV removeFromSuperview];
  431. }
  432. #pragma mark 获取webrct 的链接信息
  433. -(void)queryWebRtcMsgFun:(BOOL)isPlayerType
  434. {
  435. if(isPlayerType){
  436. if(ksharedAppDelegate.DeviceWebRtcMsgMod && ksharedAppDelegate.DeviceWebRtcMsgMod.data.sn){
  437. [self gotoWebRtcVcBy:ksharedAppDelegate.DeviceWebRtcMsgMod];
  438. return;
  439. }
  440. [self showNewIndicatorWithCanBack:YES canTouch:NO];
  441. }
  442. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  443. KWeakSelf
  444. [[netWorkManager shareInstance] CommonPostCallBackCode:webrctQueryByClient Parameters:paraDict success:^(id _Nonnull responseObject){
  445. if(isPlayerType){
  446. [weakSelf removeNewIndicator];
  447. }
  448. webRtcMsgModel *curModel = [[webRtcMsgModel alloc] initWithDictionary:responseObject error:nil];
  449. if(curModel && curModel.status == 0){
  450. ksharedAppDelegate.DeviceWebRtcMsgMod = curModel;
  451. if(isPlayerType){
  452. [weakSelf gotoWebRtcVcBy:curModel];
  453. }
  454. }
  455. else
  456. {
  457. if(isPlayerType && curModel.msg){
  458. [[iToast makeText:curModel.msg] show];
  459. }
  460. }
  461. } failure:^(NSError * _Nonnull error) {
  462. if(isPlayerType){
  463. [weakSelf removeNewIndicator];
  464. [[iToast makeText:NSLocalizedString(@"get_webrtcMsg_fail_tip",nil)] show];
  465. }
  466. }];
  467. }
  468. #pragma mark 跳转webrtc 页面
  469. - (void)gotoWebRtcVcBy:(webRtcMsgModel*)webRtcMsgMod
  470. {
  471. NSArray * vcArrs = self.navigationController.viewControllers;
  472. if(vcArrs.count != 1){
  473. return;
  474. }
  475. [cachesFileManager writeLogsWithMsg:@"webRtcPlayer push webRtcPlayerVC"];
  476. webRtcPlayerViewController *vc = [webRtcPlayerViewController new];
  477. vc.webRtcMsgMod = webRtcMsgMod;
  478. [self.navigationController pushViewController:vc animated:YES];
  479. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  480. ksharedAppDelegate.isCloudPhoneModeNotPrivacyModeOpenType = NO;
  481. ksharedAppDelegate.isCloudPhoneModeAndPrivacyModeOpenType = NO;
  482. ksharedAppDelegate.needToPushWebRtcVCType = NO;
  483. });
  484. }
  485. #pragma mark 输入密码完成
  486. - (void)didInpuPwdOkFun
  487. {
  488. KWeakSelf
  489. mainBlock(^{
  490. if(ksharedAppDelegate.isCloudPhoneModeAndPrivacyModeOpenType
  491. || ksharedAppDelegate.needToPushWebRtcVCType){
  492. [weakSelf queryWebRtcMsgFun:YES];
  493. }
  494. });
  495. }
  496. #pragma mark 上传应用
  497. - (void)gotoAPPVCFun
  498. {
  499. NasPreviewAPPViewController *vc = [NasPreviewAPPViewController new];
  500. [self.navigationController pushViewController:vc animated:YES];
  501. }
  502. @end