Skip to content

Commit

Permalink
pt6 - improve RTCDtlsTransport-state.html addIceCandidate calls.
Browse files Browse the repository at this point in the history
Make these calls more acceptable to Chrome.

Depends on 96662

Differential Revision: https://phabricator.services.mozilla.com/D96774

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1654399
gecko-commit: feab772596ad39e2566f02f07ef56cda60e19231
gecko-reviewers: bwc
  • Loading branch information
mfromanmoz authored and jgraham committed Feb 4, 2021
1 parent 40c440f commit 827142d
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions webrtc/RTCDtlsTransport-state.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,22 @@
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());

pc1.onicecandidate = e => pc2.addIceCandidate(e.candidate);
pc2.onicecandidate = e => pc1.addIceCandidate(e.candidate);
pc1.onicecandidate = e => {
if (e.candidate) {
pc2.addIceCandidate({
candidate: e.candidate.candidate,
sdpMid: e.candidate.sdpMid
});
}
}
pc2.onicecandidate = e => {
if (e.candidate) {
pc1.addIceCandidate({
candidate: e.candidate.candidate,
sdpMid: e.candidate.sdpMid
});
}
}

pc1.addTransceiver("video");
pc1.addTransceiver("audio");
Expand Down

0 comments on commit 827142d

Please sign in to comment.