我们可以使用H5中的input标签来调用原生摄像头,录音及文件管理
1. 调用相机拍照:
<input type="file" accept="image/*" capture="camera" @change="add($event)">
2. 调用相机录视频:
<input type="file" accept="video/*" capture="camcorder" @change="add($event)">
3. 调用录音及文件管理:
<input type="file" accept="audio/*" capture="microphone" @change="add($event)">
4. 调用相机及文件管理:
<input type="file" accept="video/*" capture="camcorder" @change="add($event)">
利用@change事件获取所记录的信息:
uploadImg(e) {
console.log(e.target.files)
},
ok,问题解决