Created
June 30, 2019 19:37
-
-
Save Shadid12/bd8a430d1d5de6b6105a846475811612 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//public/index.js | |
... | |
var answersFrom = {}, offer; | |
socket.on('answer-made', function (data) { | |
pc.setRemoteDescription(new sessionDescription(data.answer), function () { | |
document.getElementById(data.socket).setAttribute('class', 'active'); | |
if (!answersFrom[data.socket]) { | |
createOffer(data.socket); | |
answersFrom[data.socket] = true; | |
} | |
}, error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment