消息附件创建工具类
更多...
|
| static V2NIMMessageImageAttachment | createImageAttachment (String imagePath, String name, String sceneName, Integer width, Integer height, long size, String md5, String url, String ext) |
| | 构造图片消息附件 更多...
|
| |
| static V2NIMMessageAudioAttachment | createAudioAttachment (String audioPath, String name, String sceneName, Integer duration, long size, String md5, String url, String ext) |
| | 构造语音消息附件 更多...
|
| |
| static V2NIMMessageVideoAttachment | createVideoAttachment (String videoPath, String name, String sceneName, Integer duration, Integer width, Integer height, long size, String md5, String url, String ext) |
| | 构造视频消息附件 更多...
|
| |
| static V2NIMMessageFileAttachment | createFileAttachment (String filePath, String name, String sceneName, long size, String md5, String url, String ext) |
| | 构造文件消息附件 更多...
|
| |
| static V2NIMMessageLocationAttachment | createLocationMessageAttachment (double latitude, double longitude, String address) |
| | 构造地理位置消息附件 更多...
|
| |
| static V2NIMMessageAttachment | createCustomMessageAttachment (String rawAttachment) |
| | 构造自定义消息附件 更多...
|
| |
| static V2NIMMessageAudioAttachment com.netease.nimlib.sdk.v2.message.V2NIMMessageAttachmentCreator.createAudioAttachment |
( |
String |
audioPath, |
|
|
String |
name, |
|
|
String |
sceneName, |
|
|
Integer |
duration, |
|
|
long |
size, |
|
|
String |
md5, |
|
|
String |
url, |
|
|
String |
ext |
|
) |
| |
|
static |
构造语音消息附件
- 参数
-
| audioPath | 语音文件地址 |
| name | 语音文件显示名称 |
| sceneName | 文件存储场景名 自定义场景使用之前, 需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 传空默认使用:V2NIMStorageSceneConfig.DEFAULT_IM |
| duration | 语音文件播放长度 |
| size | 文件大小 |
| md5 | 文件MD5 |
| url | 文件上传服务器后的url |
| ext | 文件扩展名 |
- 返回
- V2NIMMessageAudioAttachment
在文件 V2NIMMessageAttachmentCreator.java 第 86 行定义.
| static V2NIMMessageAttachment com.netease.nimlib.sdk.v2.message.V2NIMMessageAttachmentCreator.createCustomMessageAttachment |
( |
String |
rawAttachment | ) |
|
|
static |
| static V2NIMMessageFileAttachment com.netease.nimlib.sdk.v2.message.V2NIMMessageAttachmentCreator.createFileAttachment |
( |
String |
filePath, |
|
|
String |
name, |
|
|
String |
sceneName, |
|
|
long |
size, |
|
|
String |
md5, |
|
|
String |
url, |
|
|
String |
ext |
|
) |
| |
|
static |
构造文件消息附件
- 参数
-
| filePath | 文件地址 |
| name | 文件显示名称 |
| sceneName | sceneName 文件存储场景名 自定义场景使用之前, 需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 传空默认使用:V2NIMStorageSceneConfig.DEFAULT_IM |
| size | 文件大小 |
| md5 | 文件MD5 |
| url | 文件上传服务器后的url |
| ext | 文件扩展名 |
- 返回
在文件 V2NIMMessageAttachmentCreator.java 第 186 行定义.
| static V2NIMMessageImageAttachment com.netease.nimlib.sdk.v2.message.V2NIMMessageAttachmentCreator.createImageAttachment |
( |
String |
imagePath, |
|
|
String |
name, |
|
|
String |
sceneName, |
|
|
Integer |
width, |
|
|
Integer |
height, |
|
|
long |
size, |
|
|
String |
md5, |
|
|
String |
url, |
|
|
String |
ext |
|
) |
| |
|
static |
构造图片消息附件
- 参数
-
| imagePath | 图片文件地址 |
| name | 文件显示名称 |
| sceneName | 文件存储场景名 |
| width | 图片文件宽度 |
| height | 图片文件高度 |
| size | 文件大小 |
| md5 | 文件MD5 |
| url | 文件上传服务器后的url |
| ext | 文件扩展名 |
- 返回
- V2NIMMessageImageAttachment
在文件 V2NIMMessageAttachmentCreator.java 第 37 行定义.
| static V2NIMMessageLocationAttachment com.netease.nimlib.sdk.v2.message.V2NIMMessageAttachmentCreator.createLocationMessageAttachment |
( |
double |
latitude, |
|
|
double |
longitude, |
|
|
String |
address |
|
) |
| |
|
static |
| static V2NIMMessageVideoAttachment com.netease.nimlib.sdk.v2.message.V2NIMMessageAttachmentCreator.createVideoAttachment |
( |
String |
videoPath, |
|
|
String |
name, |
|
|
String |
sceneName, |
|
|
Integer |
duration, |
|
|
Integer |
width, |
|
|
Integer |
height, |
|
|
long |
size, |
|
|
String |
md5, |
|
|
String |
url, |
|
|
String |
ext |
|
) |
| |
|
static |
构造视频消息附件
- 参数
-
| videoPath | 视频文件地址 |
| name | 视频文件显示名称 |
| sceneName | 文件存储场景名 自定义场景使用之前, 需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 传空默认使用:V2NIMStorageSceneConfig.DEFAULT_IM |
| duration | 视频文件播放长度 |
| width | 视频文件宽度 |
| height | 视频文件高度 |
| size | 文件大小 |
| md5 | 文件MD5 |
| url | 文件上传服务器后的url |
| ext | 文件扩展名 |
- 返回
- V2NIMMessageVideoAttachment
在文件 V2NIMMessageAttachmentCreator.java 第 136 行定义.
该类的文档由以下文件生成: