我有一個Firefox插件,需要網頁截圖。它工作正常,除了Youtube:播放器不顯示在圖像中,它是空白的。我注意到Firefox的所有屏幕截圖插件的相同問題,除了Fireshot。畫布截圖Youtube頁面部分空白
的截圖是通過創建頁面上的HTML畫布上完成:
var canvas = window.document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas');
canvas.width = width;
canvas.height = height;
canvas.style.width = canvas.style.maxwidth = width + "px";
canvas.style.height = canvas.style.maxheight = height + "px";
var context = canvas.getContext("2d");
context.save();
context.drawWindow(win, 0, 0, width, height, "rgb(255,255,255)");
context.restore();
var dataUrl = canvas.toDataURL('image/png');
我已經嘗試了幾件事情,但他們並沒有區別:
- 集的wmode不透明
- 延時截屏
截圖上的其他其他Flash元素網站,甚至是其他網站上嵌入的Youtube視頻都可以正常工作。
任何想法如何確保Youtube播放器是圖片的一部分?
你可以發佈幾個截圖的結果嗎? – Alex 2012-09-12 10:44:41