Ionic Capacitor app for video recording with audio

A very broad question of something I’ve always wanted to build:

How does someone use Ionic Capacitor (Angular preferably as that’s the language I know!) to make an app that can:

  • Video record
  • Do that whilst having music playing through the phone (through headphones most probably)
  • Save said video with audio of the background (not the audio playing through the phone)

I know this is v tricky through iOS because Apple wouldn’t let users do it (on the native Camera app at least) but I’ve seen people use apps for this purpose.

Many thanks :))