标题:
详解MChatManager(3)
[打印本页]
作者:
look_w
时间:
2019-4-12 15:31
标题:
详解MChatManager(3)
发送远程语音
/**
* 发送远程语音
*
* @param messageManager
* @param url
*/
public void sendRemoteAudioMessage(BmobIMConversation messageManager, String url) {
BmobIMAudioMessage msg = new BmobIMAudioMessage();
msg.setRemoteUrl(url);
messageManager.sendMessage(msg, new MessageSendListener() {
@Override
public void done(BmobIMMessage bmobIMMessage, BmobException e) {
if (mMessageListener != null) {
mMessageListener.onSendMessage(bmobIMMessage, Message.TYPE_AUDIO, e);
}
}
});
}
发送远程语音和发送远程图片也是一样的,其实后面发送的本地视频、远程视频都和前面的本地、远程差不多,我们只需要构建特定的消息实体就行了
发送本地视频
/**
* 发送本地视频
*
* @param messageManager
* @param path
*/
public void sendLocalVideoMessage(BmobIMConversation messageManager, String path) {
BmobIMVideoMessage msg = new BmobIMVideoMessage(path);
messageManager.sendMessage(msg, new MessageSendListener() {
@Override
public void done(BmobIMMessage bmobIMMessage, BmobException e) {
if (mMessageListener != null) {
mMessageListener.onSendMessage(bmobIMMessage, Message.TYPE_VIDEO, e);
}
}
});
}
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0