Merge pull request #1400 from thecodingmachine/bugA3

FIX: media tracks were not readded to a 3rd person in some situations
This commit is contained in:
Kharhamel 2021-08-31 16:30:41 +02:00 committed by GitHub
commit d7b552a513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -409,13 +409,7 @@ export class SimplePeer {
if (!localStream) { if (!localStream) {
return; return;
} }
PeerConnection.addStream(localStream);
for (const track of localStream.getTracks()) {
//todo: this is a ugly hack to reduce the amount of error in console. Find a better way.
if ((track as any).added !== undefined) continue; // eslint-disable-line @typescript-eslint/no-explicit-any
(track as any).added = true; // eslint-disable-line @typescript-eslint/no-explicit-any
PeerConnection.addTrack(track, localStream);
}
} catch (e) { } catch (e) {
console.error(`pushVideoToRemoteUser => ${userId}`, e); console.error(`pushVideoToRemoteUser => ${userId}`, e);
} }