canvas draw by video// height、height 代表视频宽和高function drawArgb(argb, width, height, ctx) { const imageData = ctx.createImageData(width, height); imageData.data.set(realdata); ctx.putImageData(imageData, 0, 0, 0, 0, width, height);}
function drawVideo(srcvideo, width, height, ctx) { ctx.drawImage(srcvideo, 0, 0, width, height) requestAnimationframe(() => { playCanvas(srcvideo, width, height, ctx) }) }
注:没有写fps控制
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)