From 2f73c499d354be859b86e556a11afe147be94dce Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 20 Aug 2014 16:36:44 +0200 Subject: [PATCH] connect example --- examples/PeerJs-Json/index.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/PeerJs-Json/index.js b/examples/PeerJs-Json/index.js index 9cd57811..b1f754a2 100644 --- a/examples/PeerJs-Json/index.js +++ b/examples/PeerJs-Json/index.js @@ -6,11 +6,10 @@ First you have to include the following libraries in your html file: ``` - + ``` -A working widget implementation is [IwcJson.xml](./IwcJson.xml) and the js-file is [index.js](./index.js) ### Create Connector The PeerJs Framework requires an API key, or you need to set up your own PeerJs server. @@ -27,6 +26,16 @@ Y.createPeerJsConnector({key: 'h7nlefbgavh1tt9'}, function(Connector, user_id){ */ yatta = new Y.JsonYatta(user_id, Connector); + /** + Next, you may want to connect to another peer. Therefore you have to receive his + user_id. If the other peer is connected to other peers, the PeerJsConnector + will automatically connect to them too. + + Transmitting the user_id is your job. + See the [TextEditing](../TextEditing/) an example on how to do that with urls. + */ + // yatta.connector.connectToPeer(peer_user_id); + /** Add a integer-property like this */