我正在尝试将视频帧捕获为图像,如下所示:
http://appcropolis.com/using-html5-canvas-to-capture-frames-from-a-video/
我的简单代码:
var video = document.getElementById("video");
var bottom = document.getElementById("bottom");
var canvas = document.createElement('canvas');
canvas.width = 500;
canvas.height = 282;
var ctx = canvas.getContext('2d');
ctx.drawImage(video, 0, 0, 500, 282);
bottom.innerHTML = '';
bottom.appendChild(canvas);
在 IE 上效果很好,但在 Chrome 上我总是有黑色画布......
演示在这里:
http://html5-canvas-test.vipserv.org/
知道如何解决这个问题吗?