收藏
回答

文档实例代码错误

https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html

示例代码的 `res.tempFiles` 是个数组,不是对象,直接访问 `res.tempFiles.tempFilePath` 返回的是 undefined

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)
  }
})
回答关注问题邀请回答
收藏
登录 后发表内容