fix(recording) Fix local recording (#12531)

Starting chrome 107, the recorder does not record any data if the audio stream has no tracks
To fix this we create a track for the local user (muted track)
This commit is contained in:
Robert Pintilii 2022-11-10 10:22:42 +02:00 committed by GitHub
parent cc33930259
commit 19a9b17425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 2 deletions

View File

@ -219,6 +219,17 @@ const LocalRecordingManager: ILocalRecordingManager = {
permittedOrigins: [ '*' ]
});
}
const localAudioTrack = getLocalTrack(tracks, MEDIA_TYPE.AUDIO)?.jitsiTrack?.track;
// Starting chrome 107, the recorder does not record any data if the audio stream has no tracks
// To fix this we create a track for the local user(muted track)
if (!localAudioTrack) {
APP.conference.muteAudio(false);
setTimeout(() => APP.conference.muteAudio(true), 100);
await new Promise(resolve => {
setTimeout(resolve, 100);
});
}
const currentTitle = document.title;
@ -244,9 +255,10 @@ const LocalRecordingManager: ILocalRecordingManager = {
}
this.initializeAudioMixer();
this.mixAudioStream(gdmStream);
tracks.forEach((track: any) => {
const allTracks = getTrackState(getState());
allTracks.forEach((track: any) => {
if (track.mediaType === MEDIA_TYPE.AUDIO) {
const audioTrack = track?.jitsiTrack?.track;