Abstract:
Canvas convert to blob is failing.
Introduction: I have a task to generate thumbnail when a user uploads a video.
Approach I took:
I can fetch the video element from input field. (if video is being uploaded for the first time) Or there can be a file that gets loaded in video element when we update information about the video. (Let's say, we want to capture the frame or upload it from local Directory)
Drew the current frame on canvas.
Tried to convert it into a blob.
At 3rd step, I am getting this error that is:
Failed to convert Canvas to blob. Tainted canvas may not be exported
It's something new and I never tried this. When I tried to use toDataUrl (ignore syntax) it gave me the same kind of error.
How can I generate a thumbnail from video and if it's possible then can I fill "upload thumbnail" file input field with generated image or blob?
What's the preferred way of doing something similar?