diff options
author | Chris Hiszpanski <chris.hiszpanski@verkada.com> | 2022-05-22 01:36:30 -0700 |
---|---|---|
committer | Chris Hiszpanski <chris.hiszpanski@verkada.com> | 2022-05-22 01:36:30 -0700 |
commit | 8a4e7fabafd8d42b0b2cbdbd766bea49a62bfae1 (patch) | |
tree | c432758df4318d4370dd874b185888af67084655 /example/index.js | |
parent | 97261b79b20e4e53ef3a5b7a37d1ffb0b5665bcb (diff) |
Added tcp host candidate
Diffstat (limited to 'example/index.js')
-rw-r--r-- | example/index.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/example/index.js b/example/index.js index a161a10..6eae9b3 100644 --- a/example/index.js +++ b/example/index.js @@ -1,4 +1,5 @@ window.onload = function demo() { + // create peer connection let pc = new RTCPeerConnection({ iceCandidatePoolSize: 4 @@ -27,10 +28,13 @@ window.onload = function demo() { if ('candidate' in d) { if (d.candidate) { console.log("remote candidate:\n%c%s", "color: blue;", d.candidate); + pc.addIceCandidate(d).catch((e) => { + console.log("addIceCandidate:\n%c%s", "color: red;", e); + }); } } else if ('sdp' in d) { pc.setRemoteDescription(d).catch((e) => { - console.log("local error:\n%c%s", "color: red;", e); + console.log("setRemoteDescription:\n%c%s", "color: red;", e); }); console.log("remote answer:\n%c%s", "color: blue;", d.sdp); } |