Skip to content

Commit

Permalink
add console log for chat.html
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc committed Jan 21, 2024
1 parent a2aae0f commit f8862ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 10 additions & 2 deletions examples/chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@
});
const answer = JSON.parse(json);
console.log('received answer', answer.sdp.split('\r\n'));
rtc.setRemoteDescription(answer);
try {
rtc.setRemoteDescription(answer);
} catch (error) {
console.log('rtc.setRemoteDescription(answer) with error: ', error);
}
}
async function handleOffer(json) {
const offer = JSON.parse(json);
console.log('handle offer', offer.sdp.split('\r\n'));
rtc.setRemoteDescription(offer);
try {
rtc.setRemoteDescription(offer);
} catch (error) {
console.log('rtc.setRemoteDescription(offer) with error: ', error);
}
const answer = await rtc.createAnswer();
console.log('offer response', answer.sdp.split('\r\n'));
rtc.setLocalDescription(answer);
Expand Down
3 changes: 2 additions & 1 deletion src/server/session/description/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ pub(crate) fn add_candidate_to_media_descriptions(
};

m = append_candidate_if_new(candidate, 1, m); // 1: RTP
m = append_candidate_if_new(candidate, 2, m); // 2: RTCP

//TODO: m = append_candidate_if_new(candidate, 2, m); // 2: RTCP

if ice_gathering_state != RTCIceGatheringState::Complete {
return Ok(m);
Expand Down

0 comments on commit f8862ef

Please sign in to comment.