摄像头自动重连5次

This commit is contained in:
kai 2021-08-31 22:24:47 +08:00
parent 7c5930b6d0
commit add3b8e0b0
1 changed files with 20 additions and 7 deletions

View File

@ -111,6 +111,9 @@ Strong MessageAlertView *popView;
@property(nonatomic,strong) ELPCircleConsoleView *directionView; @property(nonatomic,strong) ELPCircleConsoleView *directionView;
Weak UIView *remoteView;//player Weak UIView *remoteView;//player
Strong UIImage *screenShotImage;// Strong UIImage *screenShotImage;//
// 5
@property (assign, nonatomic) NSInteger retryTime;
@end @end
extern BOOL formLogIn;// extern BOOL formLogIn;//
BOOL isfromCameraView;// BOOL isfromCameraView;//
@ -353,13 +356,23 @@ Strong UIImage *screenShotImage;//截图
NSLog(@"[p2pCallDevice-Accept],paras=%@",parameters); NSLog(@"[p2pCallDevice-Accept],paras=%@",parameters);
} reject:^(GWP2PCallError error, NSString *errorCode) { } reject:^(GWP2PCallError error, NSString *errorCode) {
_isReject=YES; if (error==GWP2PCallErrorTimeout&&self.retryTime<5)
NSLog(@"摄像头连接失败"); {
dispatch_async(dispatch_get_main_queue(), ^{ self.retryTime++;
[self.view hideToast]; [self monitorP2PCall];
[self.view makeToast:@"连接失败"]; return;
[self hiddenMonitoringUI:NO callWithErrorType:(NSInteger)error isReCall:NO]; }
}); else
{
_isReject=YES;
NSLog(@"摄像头连接失败");
dispatch_async(dispatch_get_main_queue(), ^{
[self.view hideToast];
[self.view makeToast:@"连接失败"];
[self hiddenMonitoringUI:NO callWithErrorType:(NSInteger)error isReCall:NO];
});
}
} ready:^{ } ready:^{