Skip to content

Commit e2536f1

Browse files
committed
Implement suggestions from @nitobuendia 's review on #33
1 parent 130732d commit e2536f1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

step-05/js/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ socket.on('message', function(message) {
7979
pc.setRemoteDescription(new RTCSessionDescription(message));
8080
} else if (message.type === 'candidate' && isStarted) {
8181
var candidate = new RTCIceCandidate({
82+
candidate: message.candidate,
83+
sdpMid: message.id,
8284
sdpMLineIndex: message.label,
83-
candidate: message.candidate
8485
});
8586
pc.addIceCandidate(candidate);
8687
} else if (message === 'bye' && isStarted) {

step-06/js/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ function signalingMessageCallback(message) {
160160

161161
} else if (message.type === 'candidate') {
162162
peerConn.addIceCandidate(new RTCIceCandidate({
163-
sdpMLineIndex: message.label,
163+
candidate: message.candidate,
164164
sdpMid: message.id,
165-
candidate: message.candidate
166-
}));// Firefox compatible
165+
sdpMLineIndex: message.label,
166+
}));
167167

168168
} else if (message === 'bye') {
169169
// TODO: cleanup RTC connection?

0 commit comments

Comments
 (0)