注册

集成UI,点击实时语音与视频没有反应

我集成了官方的UI,其他功能可以用了,但点击实时语音和实时视频,键盘直接退下,然后没有任何反应。查看相关代码如下,感觉ChatViewController没有实现对应功能:
 
- (void)handleCallNotification:(NSNotification *)notification
{
id object = notification.object;
if ([object isKindOfClass:[NSDictionary class]]) {

//开始call
self.isInvisible = YES;

}
else
{
//结束call
self.isInvisible = NO;
}
}
已邀请:
同时我在网上找到了一些代码如下。但两个问题,
1.点击同样没有反应。
2.没有对应的UI。
 
 
id object = notification.object;
if ([object isKindOfClass:[NSDictionary class]]) {
if (![self canRecord]) {
return;
}

EMError *error = nil;
NSString *chatter = [object objectForKey:@"chatter"];
EMCallSessionType type = [[object objectForKey:@"type"] intValue];
EMCallSession *callSession = nil;
if (type == eCallSessionTypeAudio) {
callSession = [[EaseMob sharedInstance].callManager asyncMakeVoiceCall:chatter timeout:50 error:&error];
}
else if (type == eCallSessionTypeVideo){
if (![CallViewController canVideo]) {
return;
}
callSession = [[EaseMob sharedInstance].callManager asyncMakeVideoCall:chatter timeout:50 error:&error];
}

if (callSession && !error) {
[[EaseMob sharedInstance].callManager removeDelegate:self];

CallViewController *callController = [[CallViewController alloc] initWithSession:callSession isIncoming:NO];
callController.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self presentViewController:callController animated:NO completion:nil];
}

if (error) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"error", @"error") message:error.description delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", @"OK") otherButtonTitles:nil, nil];
[alertView show];
}
}
您需要实现- (void)callOutWithChatter:(NSNotification *)notification方法,在demo中找到该方法参考一下,监听一下该方法的执行,注意通知和代理的注册,正常是执行呼出操作随机跳转页面,跳转后的页面由CallViewController.m类管理。
http://www.easemob.com/downloads这个地方下载的SDKdemo中就有实现的,您可以找到该方法的实现。
有画面 但是不能工作 没实现功能
如果你直接用的是环信demo源码直接引用,并且即时聊天其他模块都正常只有语音、视频聊天以及视频选择点击没有反应的话,很有可能是你的AndroidManifest.xml中相关的服务前缀包名你没有替换为你自己的包名,也就是替换
com.hyphenate.chatuidemo这个包名,还有布局文件xml中的有些自定义控件的前缀包名你也要替换为你自己的包名,你不替换的话AS运行也不会报错提示的,所以你可以Find in path 全局搜索下"com.hyphenate.chatuidemo"然后替换下。

360截图20160626090636636.jpg


 

要回复问题请先登录注册