差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 后一修订版 两侧同时换到之后的修订记录 | ||
im:web:basics:message [2020/07/29 08:58] zhangdong [发送附件消息] |
im:web:basics:message [2020/08/12 09:37] lizg [发送URL图片消息] |
||
---|---|---|---|
行 238: | 行 238: | ||
* 示例代码为单聊,贴图发送至群组和聊天室时需参考**发送文本消息**修改''roomType''和''msg.setGroup('groupchat')''。 | * 示例代码为单聊,贴图发送至群组和聊天室时需参考**发送文本消息**修改''roomType''和''msg.setGroup('groupchat')''。 | ||
+ | * App端需要开发者自己实现下载,Web端需要在 WebIMConfig.js中 设置 useOwnUploadFun: true。 | ||
单聊通过URL发送图片消息的代码示例如下: | 单聊通过URL发送图片消息的代码示例如下: | ||
行 335: | 行 336: | ||
apiUrl: WebIM.config.apiURL, | apiUrl: WebIM.config.apiURL, | ||
file: file, | file: file, | ||
+ | length: '3000', // 视频文件时,单位(ms) | ||
+ | ext: { | ||
+ | file_length: file.data.size // 文件大小 | ||
+ | }, | ||
to: 'username', // 接收消息对象 | to: 'username', // 接收消息对象 | ||
roomType: false, | roomType: false, | ||
行 413: | 行 418: | ||
apiUrl: WebIM.config.apiURL, | apiUrl: WebIM.config.apiURL, | ||
file: file, | file: file, | ||
- | length: '3', // 音频文件时长,单位 s | + | length: '3', // 音频文件时长,单位(s) |
to: 'username', // 接收消息对象 | to: 'username', // 接收消息对象 | ||
roomType: false, | roomType: false, |