maxDuration: 60,
//前置或者后置摄像头,默认为前后都有,即:[‘front’, ‘back’]
camera: [‘front’,‘back’],
//接口调用成功,返回视频文件的临时文件路径,详见返回参数说明
success: function(res) {
console.log(res.tempFilePaths[0])
that.setData({
src: res.tempFilePaths[0]
})
}
})
},
/**
- 当发生错误时触发error事件,event.detail = {errMsg: ‘something wrong’}
*/
videoErrorCallback: function(e) {
console.log(‘视频错误信息:’)
console.log(e.detail.errMsg)
}
})
效果
wxml
<video
id=“myVideo”
src=“http://wxsnsdy.tc.qq.com/105