From efb879423b5cdcb5868dfe885b51e33cfc1a8606 Mon Sep 17 00:00:00 2001 From: Yilun Date: Wed, 22 May 2024 22:14:14 -0700 Subject: [PATCH] format webrtc example html Signed-off-by: Yilun --- examples/webrtc.html | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/examples/webrtc.html b/examples/webrtc.html index 477795a..292184c 100644 --- a/examples/webrtc.html +++ b/examples/webrtc.html @@ -6,11 +6,6 @@ WebRTC example -

WebRTC example

@@ -19,10 +14,14 @@

WebRTC example

two clients, Alice and Bob.

- If connect to locak NKN node, please uncomment the line of rpcServerAddr in the code. + If connect to local NKN node, please uncomment the line of + rpcServerAddr in the code.

- -
@@ -57,13 +56,15 @@

WebRTC example

}); alice.onConnectFailed(() => { + // will be triggered when the multiclient fails to connect log("Alice connect failed"); }); if (useMultiClient) { for (let clientID of Object.keys(alice.clients)) { alice.clients[clientID].onConnectFailed(() => { - log("Alice client", clientID, "connect failed"); + // will be triggered when a single client fails to connect + // log("Alice client", clientID, "connect failed"); }); } } @@ -77,9 +78,7 @@

WebRTC example

log("Alice connected"); log("Bob connected"); - await new Promise((resolve, reject) => - setTimeout(resolve, 1000), - ); + await new Promise((resolve, reject) => setTimeout(resolve, 1000)); let timeSent = Date.now();