接通环信的视频聊天出现泄漏问题
代码:监听到对方呼过来的视频的时候,这边接听,然后对方挂断,这边监听到对方挂断,然后实现挂断事件,但是控制台会一直输出一个错误:error:index is Overlow in VoeClient_NetworkDisconnectederror:index is Overlow in VoeClient_NetworkDisconnectederror:index is Overlow in VoeClient_NetworkDisconnectederror:index is Overlow in VoeClient_NetworkDisconnectederror:index is Overlow in VoeClient_NetworkDisconnected,请问这是什么问题?
代码:
//中断
- (void)didReceiveCallTerminated:(EMCallSession *)aSession
reason:(EMCallEndReason)aReason
error:(EMError *)aError
{
if ([aSession.sessionId isEqualToString:self.chatVc.callSession.sessionId]) {
[self _stopCallTimer];
[self.chatVc close];
self.chatVc = nil;
if (aReason != EMCallEndReasonHangup) {
NSString *reasonStr = @"";
switch (aReason) {
case EMCallEndReasonNoResponse:
{
reasonStr = @"没有响应";
}
break;
case EMCallEndReasonDecline:
{
reasonStr = @"拒绝通话";
}
break;
case EMCallEndReasonBusy:
{
reasonStr =@"对方正在通话中...";
}
break;
case EMCallEndReasonFailed:
{
reasonStr = @"连接失败";
}
break;
default:
break;
}
if (aError) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:aError.errorDescription delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alertView show];
}
else{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:reasonStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alertView show];
}
}
}
}
//聊天界面挂断按钮
- (void)close
{
_callSession.remoteView.hidden = YES;
_callSession = nil;
_propertyView = nil;
if (_timeTimer) {
[_timeTimer invalidate];
_timeTimer = nil;
}
if (_propertyTimer) {
[_propertyTimer invalidate];
_propertyTimer = nil;
}
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_CALL object:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[[AVAudioSession sharedInstance] setActive:NO error:nil];
[self.navigationController setNavigationBarHidden:NO animated:NO];
self.tabBarController.tabBar.hidden = NO;
[self.navigationController popViewControllerAnimated:NO];
});
}
代码:
//中断
- (void)didReceiveCallTerminated:(EMCallSession *)aSession
reason:(EMCallEndReason)aReason
error:(EMError *)aError
{
if ([aSession.sessionId isEqualToString:self.chatVc.callSession.sessionId]) {
[self _stopCallTimer];
[self.chatVc close];
self.chatVc = nil;
if (aReason != EMCallEndReasonHangup) {
NSString *reasonStr = @"";
switch (aReason) {
case EMCallEndReasonNoResponse:
{
reasonStr = @"没有响应";
}
break;
case EMCallEndReasonDecline:
{
reasonStr = @"拒绝通话";
}
break;
case EMCallEndReasonBusy:
{
reasonStr =@"对方正在通话中...";
}
break;
case EMCallEndReasonFailed:
{
reasonStr = @"连接失败";
}
break;
default:
break;
}
if (aError) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:aError.errorDescription delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alertView show];
}
else{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:reasonStr delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alertView show];
}
}
}
}
//聊天界面挂断按钮
- (void)close
{
_callSession.remoteView.hidden = YES;
_callSession = nil;
_propertyView = nil;
if (_timeTimer) {
[_timeTimer invalidate];
_timeTimer = nil;
}
if (_propertyTimer) {
[_propertyTimer invalidate];
_propertyTimer = nil;
}
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_CALL object:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[[AVAudioSession sharedInstance] setActive:NO error:nil];
[self.navigationController setNavigationBarHidden:NO animated:NO];
self.tabBarController.tabBar.hidden = NO;
[self.navigationController popViewControllerAnimated:NO];
});
}
没有找到相关结果
已邀请:
1 个回复
lizilong - 80后程序猿