发送远程语音
/**
* 发送远程语音
*
* @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);
}
}
});
} |