Comments (8)
变成text是因为this.im.sysManage.sendRosterMessage({type: this.fileType, 这里的type不支持audio-mp3 , 可以把asyncFileUpload的fileType 设置为'audio-mp3', 然后sendRosterMessage的type设置为'audio'。
另外之前的把asyncFileUpload的fileType 设置为'audio',但是文件不是amr,这种会导致手机端无法播放。
from lanying-im-web.
好的 谢谢你的建议 我向相关人员反馈下
from lanying-im-web.
im.sysManage.asyncFileUpload的参数fileType现在只支持mp3和amr: 如果文件为mp3格式,需要设置fileType为 'audio-mp3' ;如果为amr格式,需要设置fileType为 'audio'
from lanying-im-web.
如果要上传的话,这样录制的文件名怎么定义?这样会存在语音覆盖的问题
from lanying-im-web.
而且我试了下,fileType 为 'audio-mp3' 是无效的
from lanying-im-web.
文件名应该是你生成的,可以用时间戳和随机数保证不重复。asyncFileUpload的file参数需要传的是File对象 ( 见https://developer.mozilla.org/zh-CN/docs/Web/API/File/File ),audio-mp3 应该是有效的,无效是指报错了吗,有具体的错误信息吗。
from lanying-im-web.
@theorix 是file对象,上传 audio-mp3 会变成 text 的,设置 audio 就可以了。
from lanying-im-web.
这些问题是不是应该补充到文档里或者demo里会比较好,还有用户发送语音的时候还得走一遍上传,这是不是直接暴露一个 api 更好一些呢?貌似安卓端是一个api吧?
from lanying-im-web.
Related Issues (6)
- asyncGetRosterIdList 什么时候更新数据? HOT 1
- getConversationList获取会话列表,内容和未读信息为空 HOT 4
- 上传文件报错cors HOT 10
- 聊天室内发送文件/图片参数说明 HOT 1
- 账号在另外的设备上登录了,原来的设备有监听吗 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lanying-im-web.