First of all thanks for this very useful piece of code !
What we have observed is that whenever I record, only my local audio gets recording (including the video). Strangely if I start the record button from another window or tab, it records everything (both mine and other side audio). Looks like when the recording is initiated from the tab which is also playing back a sound, it does not record that sound.
Can you help ?