MediaRecorder seems very useful for turning WebGL animations into videos.
You can hold down a key to start recording and then generate a video once it's released.
I would prefer to save the frames as images so I can encode the video myself, there's probably a way to do that since you can get the raw frames but I haven't tried.
If I do that in the future it's also a good idea to not use delta time while recording frames to avoid frame rate issues.