暫不支援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. canvas.height); <br />var img = document.createElement("img"); <br />img.src = canvas.toDataURL(); <br />output.prepend(img); <br />}; <br />output.prepend(img); }; $(initialize); }); 效果圖就不貼了。