Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
if video has not style then get the CSS of video and then filter
  • Loading branch information
KrishavRajSingh authored May 19, 2023
1 parent 67e3d64 commit 2803016
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ captureBtnCont.addEventListener('click',(e)=>{
canvas.height = video.videoHeight;
canvas.width = video.videoWidth;
let tool = canvas.getContext("2d");
if(video.hasAttribute("filter"))
tool.filter = video.style.filter;
else{
tool.filter = getComputedStyle(video).filter;
}
tool.drawImage(video,0,0,canvas.width,canvas.height);
let imgURL = canvas.toDataURL();
if(db){
Expand Down

0 comments on commit 2803016

Please sign in to comment.