- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
from the SDK_User_Guide.v2.1.1:
peerClient.connect (loginInfo)
This function establishes a connection to the signaling server.
Parameters
loginInfo [in] An objects contains login information. For peer server, this object has two properties: host and token.
Return values
None
Example <script type="text/JavaScript”> var p2p=new Woogeen.PeerClient(); p2p.connect({host:’http://61.152.239.56:8095/’,token:’user1’}); </script>
we can see the loginInfo is host and token. which mean the $('#uid').val() below is the token.
$('#login').click(function(){
p2p.connect({host:serverAddress, token:$('#uid').val()}); // Connect to peer server
$('#uid').prop('disabled',true);
});
PeerClient.inviteWithStream
peerClient.inviteWithStream(peerId, stream, successCallback, failureCallback)
This function invites a remote client to establish a connection for chatting. The stream will be published as soon as the connection is established.
Parameters
peerId [in] Remote user’s ID.
Remarks
This method is intended to be used with Firefox. Please avoid using this method if your application only runs on Chrome.
Example
<script type="text/JavaScript”> var p2p=new Woogeen.PeerClient(); p2p.connect({host:’http://61.152.239.56:8095/’,token:’user1’}); p2p.inviteWithStream(‘user2’,localStream); </script>
my question is : I think the parameter 'token' value used in p2p.connect will be recorded as user's ID in the peer server, and can be used as the parameter 'peerId' in another peer's p2p.inviteWithStream. Is that right?
- Tags:
- HTML5
- JavaScript*
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the deep dig and feedback. Our engineer of Peer Server will look at this and get back to you later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes,you're right about this. Parameter 'token' value used in p2p.connect will be recorded as user's ID by default. We also allow 3rd to customize logical for authentication. Then, token may be different from User’s ID.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi CHUNBO H. thank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK. Cool. Let us know if you have further issues. Thanks!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page