- internals.socket.on('addPeer', function(data) {
-
- Peers.add(data.peerId, internals.tada);
- const peerId = data.peerId;
-
- const peerConnection = new RTCPeerConnection(
- { iceServers: internals.kIceServers },
- { optional: [{ DtlsSrtpKeyAgreement: true }] }
- );
-
- internals.peers[peerId] = peerConnection;
- mediaStream.getTracks().forEach((track) => {
- peerConnection.addTrack(track, localStream);
- });
+ internals.socket.on("addPeer", function ({ peerId }) {
+ /**
+ * Eventually the whole rtc connection logic should be moved to Peers.
+ * Now it only plays tadas.
+ */
+ Peers.add(peerId, tada);
+
+ const peerConnection = new RTCPeerConnection(
+ { iceServers: internals.kIceServers },
+ { optional: [{ DtlsSrtpKeyAgreement: true }] },
+ );
+
+ internals.peers[peerId] = peerConnection;
+ mediaStream.getTracks().forEach((track) => {
+ peerConnection.addTrack(track, mediaStream);
+ });