This is cool! Would be ever cooler if it could record a video clip rather than just images. You wouldn't have enough space in localStorage/IndexedDB, but you can use File System Access[0] (currently available in Chrome and Edge, strong chance of making it into Firefox and Safari in the next couple of years) which allows the user to select a folder which the clips can be saved into.
[0] https://web.dev/file-system-access/