ffmpegwasm / ffmpeg.wasm

FFmpeg for browser, powered by WebAssembly
https://ffmpegwasm.netlify.app
MIT License
14.22k stars 831 forks source link

Fix type errors in Vite example app #555

Closed zhougsoft closed 1 year ago

zhougsoft commented 1 year ago

hello! I was getting some minor TypeScript red squigglies in the Vite demo app that I was able to resolve with these changes. TS was complaining about accessing possible null refs (video & message) and data.buffer.

Since ffmpeg.readFile returns type FileData, seemed that the data needed to be cast as ArrayBuffer then converted to Uint8Array to access the buffer property.

I didn't see any contribution guidelines for the examples/misc stuff, sorry if this isn't how it's done 😅

netlify[bot] commented 1 year ago

Deploy Preview for ffmpegwasm canceled.

Name Link
Latest commit 9a3ce81c4e1064e9ccc2b2c7502caaaaf57e712e
Latest deploy log https://app.netlify.com/sites/ffmpegwasm/deploys/64dec8afeeba5f0008043194
jeromewu commented 1 year ago

Looks great! Thanks for the PR.