linphone 6.0 [audioSession setDelegate:self] 委托不能用
来源:互联网 发布:博弈树搜索算法 编辑:程序博客网 时间:2024/05/22 14:50
参考官方的说明文档, IOS6.0以后的取消了AVAudioSession的委托,改成了发送消息的方法,仔细看看委托中实现的方法 有
[selfendInterruption]; 和 [self beginInterruption]方法有在linphone中实现。
现在6.0后,改成了发送消息的方式,修改如下
1. //[audioSession setDelegate:self]; //把他改成下面的代码
[[NSNotificationCenterdefaultCenter] addObserver:self
selector: @selector(interruption:)
name: AVAudioSessionInterruptionNotification
object: [AVAudioSessionsharedInstance]];
2.重新添加一个@selector(interruption:)的实现函数
- (void) interruption:(NSNotification*)notification
{
NSDictionary *interuptionDict = notification.userInfo;
NSUInteger interuptionType = (NSUInteger)[interuptionDictvalueForKey:AVAudioSessionInterruptionTypeKey];
if(interuptionType ==AVAudioSessionInterruptionTypeBegan)
[selfbeginInterruption];
else if (interuptionType ==AVAudioSessionInterruptionTypeEnded)
[selfendInterruption];
}
- (void)beginInterruption {
LinphoneCall* c =linphone_core_get_current_call(theLinphoneCore);
[LinphoneLoggerlogc:LinphoneLoggerLogformat:"Sound interruption detected!"];
if (c) {
linphone_core_pause_call(theLinphoneCore, c);
}
}
- (void)endInterruption {
[LinphoneLoggerlogc:LinphoneLoggerLogformat:"Sound interruption ended!"];
}
- linphone 6.0 [audioSession setDelegate:self] 委托不能用
- 懒加载时为什么不能用self直接访问属性
- AudioSession
- vc 6.0 打开按钮不能用
- linphone
- linphone
- linphone
- linphone
- 看来不能用IE
- Gmail不能用怎么办
- dbms_advisor.tune_mview不能用
- 试下能用不
- 为什么不能用iDescription?
- 看看能不能用?
- dos命令不能用
- PowerPoint绘图笔不能用
- 解决不能用ping
- 开始菜单不能用
- android setBackgroundDrawable setImageBitmap 区别
- LA4015
- DES加密
- OFDM信号AutoRange问题
- 多文档程序,开始不生成新文档
- linphone 6.0 [audioSession setDelegate:self] 委托不能用
- 设计模式——行为型2
- 如何隐藏Tab Bar Controller的Tab Bar
- tar
- unity读写xml
- struts1源码阅读(3)
- 生活中小细节显大智慧
- 加强代码的强壮性,AVAudioRecorder的一个小问题
- 合理设置apache httpd的最大连接数