From 782b67c564d857c2dc388b743a1f360282481278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 20 Jun 2022 12:00:47 +0200 Subject: [PATCH] Print connection ID when checking them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes possible to identify which connection has a problem and further investigate it if desired. Signed-off-by: Daniel Calviño Sánchez --- docs/Talkbuchet.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/Talkbuchet.js b/docs/Talkbuchet.js index 25646ab9b1..d7c2386247 100644 --- a/docs/Talkbuchet.js +++ b/docs/Talkbuchet.js @@ -757,8 +757,10 @@ const setSentVideoStreamEnabled = function(enabled) { const checkPublishersConnections = function() { const iceConnectionStateCount = {} - Object.values(publishers).forEach(publisher => { - console.info(publisher.peerConnection.iceConnectionState) + Object.keys(publishers).forEach(publisherSessionId => { + publisher = publishers[publisherSessionId] + + console.info(publisherSessionId + ': ' + publisher.peerConnection.iceConnectionState) if (iceConnectionStateCount[publisher.peerConnection.iceConnectionState] === undefined) { iceConnectionStateCount[publisher.peerConnection.iceConnectionState] = 1 @@ -777,8 +779,11 @@ const checkPublishersConnections = function() { const checkSubscribersConnections = function() { const iceConnectionStateCount = {} + i = 0 + subscribers.forEach(subscriber => { - console.info(subscriber.peerConnection.iceConnectionState) + console.info(i + ': ' + subscriber.peerConnection.iceConnectionState) + i++ if (iceConnectionStateCount[subscriber.peerConnection.iceConnectionState] === undefined) { iceConnectionStateCount[subscriber.peerConnection.iceConnectionState] = 1