收藏
回答

示例代码错误

wx.chooseMedia({
  count: 9,
  mediaType: ['image','video'],
  sourceType: ['album', 'camera'],
  maxDuration: 30,
  camera: 'back',
  success(res) {
    console.log(res.tempFiles.tempFilePath)
    console.log(res.tempFiles.size)
  }
})

https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html#%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81

示例代码错误,返回的数组

wx.chooseMedia({
  count: 9,
  mediaType: ['image','video'],
  sourceType: ['album', 'camera'],
  maxDuration: 30,
  camera: 'back',
  success(res) {
    console.log(res.tempFiles[0].tempFilePath)
    console.log(res.tempFiles[0].size)
  }
})
回答关注问题邀请回答
收藏
登录 后发表内容