var canvas = document.getElementById('canvasid-clip')
var video = document.getElementById("fuckvideo")
var ctx = uni.createCanvasContext('canvasid-clip', this)
ctx.drawImage(video, 0, 0, 300, 300)
setTimeout(()=>{
ctx.draw(true, setTimeout(()=>{
uni.canvasToTempFilePath({
x: 0,
y: 0,
width: 300,
height: 300,
fileType: 'png',
canvasId: 'canvasid-clip',
success: (res) => {
base64ToPath(res.tempFilePath)
.then(path => {
this.clip = path
})
.catch(error => {
console.error(error)
})
},
fail: (res) => {
console.log(res)
},
complete: () => {}
}, this)
},0))
},500)
0 个回复