Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

capture image from video element

const video = document.getElementById("video");

const canvas = document.createElement("canvas");
// scale the canvas accordingly
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
// draw the video at that frame
canvas.getContext('2d')
  .drawImage(video, 0, 0, canvas.width, canvas.height);
// convert it to a usable data URL
const dataURL = canvas.toDataURL();
Comment

PREVIOUS NEXT
Code Example
Javascript :: puppeteer inner text 
Javascript :: ClassNotFoundException: com.fasterxml.jackson.core.JsonGenerator 
Javascript :: how to get cwd nodejs 
Javascript :: enable input jquery 
Javascript :: how to put variable in string javascript 
Javascript :: axios not defined 
Javascript :: unordered list in react native 
Javascript :: store object in local storage javascript 
Javascript :: angular 10 set error on form controle 
Javascript :: discord.js how to kick a user 
Javascript :: delete duplicates array of strings Javascript 
Javascript :: js 1d index to 2d coord 
Javascript :: protractor screen size 
Javascript :: Sailsdock 
Javascript :: date().toisostring().slice(0 10) giving wrong result 
Javascript :: call function after 2 seconds javascript 
Javascript :: Codewars Square(n) Sum 
Javascript :: eslint ignore current line 
Javascript :: javascript get cookie 
Javascript :: remove item from array by id 
Javascript :: mongodb unshift array 
Javascript :: convert seconds to hours minutes seconds javascript 
Javascript :: ajax run function after page load 
Javascript :: check if somethin exist in an object js 
Javascript :: select all checkboxes jquery 
Javascript :: what it means --skiptests==true in angular 
Javascript :: sendgrid nodejs send email template 
Javascript :: check if 2 arrays are equal javascript 
Javascript :: jq html remove disabled 
Javascript :: create new angular component command 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =