你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
[已注销]
xieyajie
-(void)audioAction:(EMMessage *)aMessage { id <IEMFileMessageBody> body = [aMessage.messageBodies firstObject]; EMAttachmentDownloadStatus downloadStatus = [body attachmentDownloadStatus]; if (downloadStatus == EMAttachmentDownloading) { //正在下载,请稍等 return; } else if (downloadStatus == EMAttachmentDownloadFailure) { //下载失败,重新下载 [[EaseMob sharedInstance].chatManager asyncFetchMessage:aMessage progress:nil]; return; } if (body.messageBodyType == eMessageBodyType_Voice) { //开启红外线检测 [[EMCDDeviceManager sharedInstance] enableProximitySensor]; //播放语音 EMChatVoice *chatVoice = (EMChatVoice *)((EMVoiceMessageBody *)body).chatObject; [[EMCDDeviceManager sharedInstance] asyncPlayingWithPath: aMessage.chatVoice.localPath completion:^(NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{ //关闭红外线检测 [[EMCDDeviceManager sharedInstance] disableProximitySensor]; }); }]; } }
要回复问题请先登录或注册
2 个回复
[已注销]
- (void)asyncPlayingWithPath:(NSString *)aFilePath
completion:(void(^)(NSError *error))completon{
xieyajie
至于EMCDDeviceManager这个类是环信封装的一个第三方开源类,在官方开源代码里能找到