TencentCloud / TIMSDK

Tencent Cloud Chat features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication.
https://trtc.io/products/chat
2.57k stars 2.76k forks source link

【小程序】-【2.1.3】:【发送语音,显示无法发送空文件】。【发送图片无响应】 #492

Closed newStudent-ls closed 4 years ago

newStudent-ls commented 4 years ago

![Uploading image.png…]()

newStudent-ls commented 4 years ago
  1. recorderManager.onStop((res) => {
  2. console.log('recorder stop')
  3. wx.hideLoading()
  4. if (this.data.canSend) {
  5. if (res.duration < 1000) {
  6. $u.showToast("录音时间太短");
  7. } else {
  8. console.log(res);
  9. console.log(IM.getMessageChar());
  10. console.log(IM.getMessageChar().sendMessage.voice(res));
  11. IM.getMessageChar().sendMessage.voice(res).send(message=>{
  12. this.addMessage(message);
  13. console.log("发送录音成功");
  14. },error=>{
  15. console.log(error);
  16. })
  17. }
  18. }
  19. })
newStudent-ls commented 4 years ago

tim-wx-sdk 2.1.3

newStudent-ls commented 4 years ago

message: e ID: "GROUP102250-1507350001-4319880-1" clientSequence: 1507350001 conversationID: "GROUP102250" conversationSubType: undefined conversationType: "GROUP" flow: "out" from: "e7a0cbfd8b4442039fd7fe874b056749" geo: {} isPlaceMessage: 0 isRead: 1 isResend: 0 isSystemMessage: 0 messagePriority: 0 payload: downloadFlag: 2 remoteAudioUrl: "" second: 2 size: 118598 url: "wxfile://tmp_9617d66f524ca4d28edea882d92f281a.m4a" uuid: "1400200009-e7a0cbfd8b4442039fd7fe874b056749-YMiDCD3RnVmaJIS5OaZK5Zq7PM6IqLMR" __proto__: Object protocol: "JSON" random: 4319880 sequence: 0 status: "fail" time: 1573110456 to: "102250" type: "TIMSoundElem" _elements: [e] _error: 0 _errorInfo: "" elements: (...)

newStudent-ls commented 4 years ago

sendMessage error: t: 无法发送空文件 at o.value (weapp:///miniprogram_npm/tim-wx-sdk/index.js:2659:63) at e._onOperatedHandle (weapp:///miniprogram_npm/tim-wx-sdk/index.js:4208:37) at e.value (weapp:///miniprogram_npm/tim-wx-sdk/index.js:2164:100) at weapp:///miniprogram_npm/tim-wx-sdk/index.js:2894:115 at t ([publib]:1:80645) at [publib]:1:80767 at e ([publib]:1:83223) at e.exports ([publib]:1:42170) at y.(anonymous function) ([publib]:1:47573) at Number.r ([publib]:1:47272)

newStudent-ls commented 4 years ago

错误码2108 无法发送空文件

newStudent-ls commented 4 years ago

还有一个现象 图片发送 没结果 也不报错,直接就消失了

newStudent-ls commented 4 years ago

图片发送没有回调 promise.then(imResponse=> { })不会执行 catch也没有

newStudent-ls commented 4 years ago

图片发送调用createImageMessage 生成的状态status 是fail.我看demo里面生成的是unSend.

newStudent-ls commented 4 years ago

图片的imageFormat 是255. demo里面是GIF

newStudent-ls commented 4 years ago

cos插件引错,小程序用wx,不是js复制错了 蛋疼