I'm attempting to create a simple WebRTC with audio and video screen recording; the video appears to be fine, but the audio is missing from the file, rest of the others functionalities working absolutely fine. Did anyone face the same issue? any solution?
function startRecording1(stream) {
mediaRecorder = new MediaRecorder(stream, {
mimeType: 'video/webm;codecs=vp9',
audio: true,
video: true
});
mediaRecorder.start(1000);
toggleRecordingIcons(true);
mediaRecorder.ondataavailable = function (e) {
recordedStream.push(e.data);
};
mediaRecorder.onstop = function () {
toggleRecordingIcons(false);
//h.saveRecordedStream(recordedStream, username);
uploadInS3Bucket(recordedStream);
};
mediaRecorder.onerror = function (e) {
console.error(e);
};
}
// Call this function here
getUserFullMedia().then((videoStream) => {
startRecording1(videoStream);
}).catch(() => { });
getUserFullMedia() {
if (this.userMediaAvailable()) {
return navigator.mediaDevices.getUserMedia({
video: true,
audio: {
echoCancellation: true,
noiseSuppression: true
},
audio: true
});
}
else {
throw new Error('User media not available');
}
}