WIP, avi not working on web

This commit is contained in:
Eric Bailey
2024-09-10 16:20:19 -05:00
parent 3c8b3b4782
commit eaf0081623
3 changed files with 276 additions and 186 deletions
+15
View File
@@ -0,0 +1,15 @@
export const getCanvas = (base64: string): Promise<HTMLCanvasElement> => {
return new Promise(resolve => {
const image = new Image()
image.onload = () => {
const canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
const ctx = canvas.getContext('2d')
ctx?.drawImage(image, 0, 0)
resolve(canvas)
}
image.src = base64
})
}