Dropzone code cleanup

This commit is contained in:
Pogodaanton 2020-06-25 20:02:56 +02:00
parent 4a81eafd76
commit 6670f47f99
1 changed files with 1 additions and 3 deletions

View File

@ -230,8 +230,6 @@ const DropzoneUpload: React.ComponentType<DropzoneUploadProps> = React.memo(
const ctx = canvas.getContext("2d");
const ctxBg = canvasBgRef.current.getContext("2d");
console.log(preview, file.type, canvasRef.current, type);
if (type === "image") {
const img = new Image();
img.addEventListener("load", () => {
@ -250,9 +248,9 @@ const DropzoneUpload: React.ComponentType<DropzoneUploadProps> = React.memo(
const seekHandler = () => {
video.removeEventListener("seeked", seekHandler);
video.pause();
console.log("seeked!");
alignImageToCanvas(video, video.videoWidth, video.videoHeight, ctx);
coverCanvasWithImage(video, video.videoWidth, video.videoHeight, ctxBg);
document.body.removeChild(video);
};
video.addEventListener("seeked", seekHandler);
video.currentTime = 0;