I need to record a meeting (screen + microphone + window audio) that is using AWS Chime JavaScript SDK. I have tried using MediaStream and MediaRecorder, but so far I have only managed to record the screen video, the speaker microphone audio and any audio that comes from different tabs in the browser. Whenever an attendee is speaking, he is not being heard on the recording.
However, when I run the same recording code, but on a local project, I am able to record the screen and the system audio, which includes everyone that speaks on the meeting. Why could that be?
This is my code:
async setupStream() {
try {
this.stream = await navigator.mediaDevices.getDisplayMedia({
video: { mediaSource: 'screen' },
audio: true,
})
this.audio = await navigator.mediaDevices.getUserMedia({
audio: true,
})
this.audioCtx = DefaultDeviceController.getAudioContext();
this.source1 = this.audioCtx.createMediaStreamSource(this.audio)
this.source2 = this.audioCtx.createMediaStreamSource(this.stream)
this.destination = this.audioCtx.createMediaStreamDestination()
this.source1.connect(this.destination)
this.source2.connect(this.destination)
} catch (err) {
console.error(err)
}
}
async start() {
wait this.setupStream()
if (this.stream && this.audio) {
this.mixedStream = new MediaStream()
this.mixedStream.addTrack(this.stream.getVideoTracks()[0])
this.mixedStream.addTrack(this.destination.stream.getAudioTracks()[0])
this.recorder = new MediaRecorder(this.mixedStream)
this.chunks = []
this.recorder.ondataavailable = (e) => this.chunks.push(e.data)
this.onStopRecord()
this.recorder.start(1000)
this.recordStart()
this.recording = true
this.modal = false
}
}
Any idea idea on how to record a meeting using AWS Chime?