Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

canvas squashed video javascript

function capture(elemID) {
  const canvas = document.createElement("canvas");
  var video = document.getElementById(elemID)
  canvas.width = video.videoWidth
  canvas.height = video.videoHeight
  canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);

  var data = canvas.toDataURL('image/png');
  let blobImage = DataURIToBlob(data)
  console.log(blobImage)
  console.log(data)
}
 
PREVIOUS NEXT
Tagged: #canvas #squashed #video #javascript
ADD COMMENT
Topic
Name
8+5 =