I would like to take screenshots of the destination application on a Chromecast device. I need it to work on the device to show the video and the application together.
Is there any way to do this?
No, this is not possible for many reasons, such as media rights and security.
Ali Naddaf’s answer is technically correct, however, with a little work, I was able to make an accurate reconstruction of the screen, to such an extent that it is indistinguishable from the actual screenshot.
:
html2canvas (document.body, {onrendered: function (canvas) {document.write('');}});
( , , )
zsolt-szatmari script, Chromecast Developer Tools:
, http://html2canvas.hertzen.com/build/html2canvas.js
html2canvas: canvas DOM: html2canvas(document.body, { onrendered: function(canvas) { document.body.appendChild(canvas); } });.
html2canvas(document.body, { onrendered: function(canvas) { document.body.appendChild(canvas); } });
base64 , : document.getElementsByTagName('canvas')[0].toDataURL('image/png');
document.getElementsByTagName('canvas')[0].toDataURL('image/png');
base64: , Chrome . , , Chromecast - html2canvas:
DOM , , 100% , , .
()
, , javascript :
var canvas = document.getElementById("mycanvas"); var img = canvas.toDataURL("image/png");
, - - , . , .
, , . , "" , javascript, , - URL- . . , - , , html + css + javascript-.