From 1e20466f740d83b5253973b9ceb6d93d4f4e2c99 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Tue, 31 Aug 2021 15:55:00 +0200 Subject: [PATCH] FIX: media tracks were not readded to a 3rd person in some situations --- front/src/WebRtc/SimplePeer.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/front/src/WebRtc/SimplePeer.ts b/front/src/WebRtc/SimplePeer.ts index 04075df2..1b07c208 100644 --- a/front/src/WebRtc/SimplePeer.ts +++ b/front/src/WebRtc/SimplePeer.ts @@ -409,13 +409,7 @@ export class SimplePeer { if (!localStream) { return; } - - 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); - } + PeerConnection.addStream(localStream); } catch (e) { console.error(`pushVideoToRemoteUser => ${userId}`, e); }