wx.chooseImage 在PC微信开发者工具里面没有调起摄像头,手机却可以,为什么?

发布于 6 年前作者 jun476238 次浏览最后编辑 6 年前来自 issues

1.02.1909122 Windows 64Windows 32macOS

使用的是

开发版 Nightly Build

最新版本 64位的。

贴个代码:

wx.chooseVideo({

sourceType: [‘album’, ‘camera’],

maxDuration: 60,

camera: ‘front’,

success(res) {

console.log(res.tempFilePath)

wx.uploadFile({

url: http://192.168.43.72/test2, //仅为示例,非真实的接口地址

filePath: res.tempFilePath,

name: ‘file’,

formData: {

‘user’: ‘test’

},

success(res) {

const data = res.data

//do something

}

})

}

})

1 回复
leifan
leifan1 楼4 年前

开发工具不会调起摄像头的。如果你也不想在手机调起,设置这个属性