Skip to content

Instantly share code, notes, and snippets.

@jefBinomed
Created June 17, 2015 14:49
Show Gist options
  • Save jefBinomed/f524a35662675351eb2f to your computer and use it in GitHub Desktop.
Save jefBinomed/f524a35662675351eb2f to your computer and use it in GitHub Desktop.
Programmez-07/08_2015-PortalWebrtc-04
var canvasRemoteElement = document.querySelector('#canvasRemoteVideo');
var ctxRemote = canvasRemoteElement.getContext('2d');
function snapshot(){
var canvasToUse = canvasRemoteElement;
var contextToUse = ctxRemote;
varvideoToUse = remoteVideo;
canvasRemoteElement.width = remoteVideo.videoWidth;
canvasRemoteElement.height = remoteVideo.videoHeight;
if (remoteStream){
ctxRemote.drawImage(remoteVideo,0,0);
}
window.requestAnimationFrame(snapshot);
}
snapshot();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment