@@ -126,8 +126,15 @@ - (void)viewDidLoad {
126126
127127 [self setupPreViewViews ];
128128
129- [self requestXp2pInfo ];
130-
129+ TIoTCoreAppEnvironment *env = [TIoTCoreAppEnvironment shareEnvironment ];
130+ int errorcode = [[TIoTCoreXP2PBridge sharedInstance ] startAppWith: env.cloudProductId dev_name: self .deviceName?:@" " ];
131+ if (errorcode == XP2P_ERR_VERSION) {
132+ UIAlertController *alertC = [UIAlertController alertControllerWithTitle: @" APP SDK 版本与设备端 SDK 版本号不匹配,版本号需前两位保持一致" message: nil preferredStyle: (UIAlertControllerStyleAlert)];
133+ UIAlertAction *alertA = [UIAlertAction actionWithTitle: @" 确定" style: (UIAlertActionStyleDefault) handler: ^(UIAlertAction * _Nonnull action) {
134+ }];
135+ [alertC addAction: alertA];
136+ [self presentViewController: alertC animated: YES completion: nil ];
137+ }
131138 UIBarButtonItem *right = [[UIBarButtonItem alloc ] initWithTitle: @" 播放调试面板" style: UIBarButtonItemStylePlain target: self action: @selector (showHudView )];
132139 self.navigationItem .rightBarButtonItem = right;
133140}
@@ -138,16 +145,8 @@ - (void)requestDiffDeviceDataWithXp2pInfo:(NSString *)xp2pInfo {
138145 [self requestCloudStoreVideoList ];
139146
140147 TIoTCoreAppEnvironment *env = [TIoTCoreAppEnvironment shareEnvironment ];
141- int errorcode = [[TIoTCoreXP2PBridge sharedInstance ] startAppWith: env.cloudProductId dev_name: self .deviceName?:@" " ];
142148 [[TIoTCoreXP2PBridge sharedInstance ] setXp2pInfo: self .deviceName?:@" " sec_id: env.cloudSecretId sec_key: env.cloudSecretKey xp2pinfo: xp2pInfo?:@" " ];
143-
144- if (errorcode == XP2P_ERR_VERSION) {
145- UIAlertController *alertC = [UIAlertController alertControllerWithTitle: @" APP SDK 版本与设备端 SDK 版本号不匹配,版本号需前两位保持一致" message: nil preferredStyle: (UIAlertControllerStyleAlert)];
146- UIAlertAction *alertA = [UIAlertAction actionWithTitle: @" 确定" style: (UIAlertActionStyleDefault) handler: ^(UIAlertAction * _Nonnull action) {
147- }];
148- [alertC addAction: alertA];
149- [self presentViewController: alertC animated: YES completion: nil ];
150- }
149+ [self setVieoPlayerStartPlayWith: self .qualityString];
151150
152151 // 计算IPC打洞开始时间
153152 self.startIpcP2P = CACurrentMediaTime ();
@@ -1190,7 +1189,8 @@ - (void)refushVideo:(NSNotification *)notify {
11901189 self.startPlayer = CACurrentMediaTime();
11911190 });
11921191 */
1193- [self setVieoPlayerStartPlayWith: self .qualityString];
1192+ [self requestXp2pInfo ];
1193+ // [self setVieoPlayerStartPlayWith:self.qualityString];
11941194
11951195// [self getDeviceStatusWithType:action_live qualityType:self.qualityString];
11961196 }
@@ -1666,6 +1666,7 @@ - (void)appNetWorkBreak {
16661666}
16671667
16681668- (void )appNetWorkResume {
1669+ return ;
16691670 if (self.endPlayer == 0 ) { // 正在直播中,断开才响应
16701671 return ;
16711672 }
0 commit comments