From 97261b79b20e4e53ef3a5b7a37d1ffb0b5665bcb Mon Sep 17 00:00:00 2001 From: Chris Hiszpanski Date: Sat, 21 May 2022 15:25:35 -0700 Subject: * Added trtc_ prefixes * Split into tinyrtc.c/h * Sending answer * Answer validates --- example/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'example/index.js') diff --git a/example/index.js b/example/index.js index 35fdbba..a161a10 100644 --- a/example/index.js +++ b/example/index.js @@ -26,10 +26,13 @@ window.onload = function demo() { let d = JSON.parse(event.data); if ('candidate' in d) { if (d.candidate) { - console.log("remote candidate:\n%c%s", "color: blue;", event.data); + console.log("remote candidate:\n%c%s", "color: blue;", d.candidate); } } else if ('sdp' in d) { - console.log("remote answer:\n%c%s", "color: blue;", event.data); + pc.setRemoteDescription(d).catch((e) => { + console.log("local error:\n%c%s", "color: red;", e); + }); + console.log("remote answer:\n%c%s", "color: blue;", d.sdp); } } catch(e) { console.log("remote error:\n%c%s", "color: red;", event.data); -- cgit v1.2.3