cloudPhoneViewController.m 22 KB

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