part-of-screen-sharing/firebase/index.html
Copyright © 2013 Muaz Khan<@muazkh>. @WebRTCWeb
Share DIV Number 1
Share DIV Number 2
Share DIV Number 3
<script src="https://www.webrtc-experiment.com/screenshot.js"></script>
<script>
var divToShare = document.querySelector('div');
html2canvas(divToShare, {
onrendered: function (canvas) {
var screenshot = canvas.toDataURL();
// image.src = screenshot;
// context.drawImage(screenshot, x, y, width, height);
// firebase.push(screenshot);
// pubnub.send(screenshot);
// socketio.send(screenshot);
// signaler.send(screenshot);
// window.open(screenshot);
}
});
/*
## Note:
Put above code in a function; use "requestAnimationFrame" to loop the function
and post/transmit DataURL in realtime!
## What above code will do?
Above code will take screenshot of the DIV or other HTML element and return you
and image. You can preview image to render in IMG element or draw to Canvas2D.
*/
</script>
Send Message