@@ -21,19 +21,19 @@ function getVideo() {
2121
2222//every 16ms (60fps), take a screenshot from the webcam and paint it on the canvas
2323function paintToCanvas ( ) {
24- const width = video . videoWidth ; // different de video.width ? taille de la video, et non pas de l'élément <video> ?
24+ const width = video . videoWidth ; // different de video.width ? taille de la video, et non pas de l'�l�ment <video> ?
2525 const height = video . videoHeight ;
2626 canvas . width = width ;
2727 canvas . height = height ;
2828 // return in case we need to stop the painting
2929 return setInterval ( ( ) => {
3030 ctx . drawImage ( video , 0 , 0 ) ;
3131
32- //recupération des pixels de l'image pour faire des trucs funky
32+ //recuperation des pixels de l'image pour faire des trucs funky
3333 let pixels = ctx . getImageData ( 0 , 0 , width , height ) ;
3434 //Array : r,g,b,alpha,r,g,b,alpha, etc. 4 entries in the array for each pixel
3535 //let's mess with the pixels
36- pixels = redEffect ( pixels ) ;
36+ // pixels = redEffect(pixels);
3737
3838 // pixels = rgbtSplit(pixels);
3939
@@ -47,12 +47,12 @@ function takePhoto() {
4747 snap . currentTime = 0 ; //rewind sound every time
4848 snap . play ( ) ;
4949 // get the data from the canvas. data will be a base64 string
50- const data = canvas . getDataURL ( 'image/jpeg' ) ;
50+ const data = canvas . toDataURL ( 'image/jpeg' ) ;
5151 // create the download link for the snapshot
5252 const link = document . createElement ( 'a' ) ;
5353 link . href = data ;
5454 link . setAttribute ( 'download' , 'handsome' ) ; //name of the file
55- link . innerHTML = `<img src="${ data } " alt="handsome me"` ;
55+ link . innerHTML = `<img src="${ data } " alt="handsome me"/> ` ;
5656 // insert the link
5757 strip . insertBefore ( link , strip . firstChild ) ;
5858}
0 commit comments