From 7e7888029e08bd0b5c83abb51155fea3c276538b Mon Sep 17 00:00:00 2001 From: Khush Jammu Date: Fri, 5 Jun 2020 18:39:26 +0800 Subject: [PATCH] fix issue: peers couldn't connect with person sharing screen --- public/js/chat.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/js/chat.js b/public/js/chat.js index 7ee693c..2ddc20b 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -32,7 +32,6 @@ var dataChannel = new Map(); var VideoChat = { videoEnabled: true, audioEnabled: true, - borderColor: `hsl(${Math.floor(Math.random() * 360)}, 70%, 80%)`, connected: new Map(), localICECandidates: {}, socket: io(), @@ -40,7 +39,7 @@ var VideoChat = { localVideo: document.getElementById("local-video"), peerConnections: new Map(), recognition: undefined, - borderColor: undefined, + borderColor: "hsl(120,100%,70%)", peerColors: new Map(), // Call to getUserMedia (provided by adapter.js for cross browser compatibility) @@ -99,7 +98,7 @@ var VideoChat = { }, }); - VideoChat.borderColor = uuidToColor(VideoChat.socket.id); + // VideoChat.borderColor = uuidToColor(VideoChat.socket.id); VideoChat.localVideo.srcObject = stream; VideoChat.localVideo.style.border = `3px solid ${VideoChat.borderColor}`; @@ -666,7 +665,7 @@ function switchStreamHelper(stream) { } }); // Update local video stream - VideoChat.localStream = videoTrack; + VideoChat.localStream = stream; // Update local video object VideoChat.localVideo.srcObject = stream; // Unpause video on swap