暂不支持chrom 。支持safari .其他未测试 先引用 jquery 地址。选用新浪的 复制代码代码如下: 加一个video标签 复制代码代码如下: 然后js 复制代码代码如下: <br />$().ready(function(){ <br />var video, output; <br />var scale = 0.25; <br />var initialize = function() { <br />output = $("#output"); <br />video = $("#video").get(0); <br />$("#capture").click(captureImage); <br />}; <br />var captureImage = function() { <br />var canvas = document.createElement("canvas"); <br />canvas.width = video.videoWidth * scale; <br />canvas.height = video.videoHeight * scale; <br />canvas.getContext('2d') <br />.drawImage(video, 0, 0, canvas.width, canvas.height); <br />var img = document.createElement("img"); <br />img.src = canvas.toDataURL(); <br />output.prepend(img); <br />}; <br />$(initialize); <br />}); <br /> 效果图就不贴了。