1

it captures the image and when I try to use canva.toDataURL() it does not give us an image and throws the exception on the console

(index):45 Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

 function shoot() { 
 var video = document.getElementById(videoId);
 var output = document.getElementById('output'); 
 var canvas = capture(video, scaleFactor); canvas.onclick = function(){ 
 window.open(this.toDataURL()); alert(this.toDataURL()) }; 
 snapshots.unshift(canvas);
 output.innerHTML = ''; 
 for (var i = 0; i < 1; i++) {
 output.appendChild(snapshots[i]); 
 } 

I think problem in this onclick function

mTvare
  • 327
  • 1
  • 2
  • 14
Nabeel Bhatti
  • 99
  • 2
  • 10

0 Answers0