Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example usage Confusion #26

Closed
cfreeman opened this issue Sep 8, 2014 · 9 comments
Closed

Example usage Confusion #26

cfreeman opened this issue Sep 8, 2014 · 9 comments

Comments

@cfreeman
Copy link

cfreeman commented Sep 8, 2014

Sorry, this is a really dumb n00b question. I have been struggling to get the basic example usage to work:

var quickconnect = require('rtc-quickconnect');

var opts = {
   room: 'qc-simple-demo',
   debug: true
};

console.log('establishing connection');

quickconnect('http://rtc.io/switchboard/', opts)
  .on('call:started', function(id, pc, data) {
    console.log('we have a new connection to: ' + id);
});

I get the following output:

establishing connection
rtc-signaller: signaller 71041785-91dd-46ec-bd6b-b3094bf018eb received data: /roominfo|{"memberCount":1} 

But I was expecting:

establishing connection
rtc-signaller: signaller 71041785-91dd-46ec-bd6b-b3094bf018eb received data: /roominfo|{"memberCount":1} 
we have a new connection to: //some id
@DamonOehlman
Copy link
Member

Not dumb at all. The call:started event is related to when two parties have established a P2P connection to each other. I think you are probably looking for the plain old connected event if you are wanting an indication of when quickconnect has established connectivity with the signalling server.

The id, however, isn't reported in this event as it is assigned on the client prior. It should be available with the following code:

quickconnect('http://rtc.io/switchboard/', opts)
  .on('connected', function() {
    console.log('talking to the signalling server, and my id is: ' + this.id);
  })
  .on('call:started', function(id, pc, data) {
    console.log('we have a new connection to: ' + id);
});

@cfreeman
Copy link
Author

cfreeman commented Sep 8, 2014

Muchas gracias, clears up my misconceptions.

@cfreeman cfreeman closed this as completed Sep 8, 2014
@silviapfeiffer
Copy link
Member

Would be worth adding this to the documentation of the events.
I can't see that event mentioned at https://github.com/rtc-io/rtc-quickconnect/blob/master/docs/events.md

@DamonOehlman
Copy link
Member

I really wanted to avoid duplicating the information. There's a link to the signaller events in the opening sentence in that events documentation, maybe I just need to make that more obvious to draw peoples attention to it..

@silviapfeiffer
Copy link
Member

My bad. Yet again I missed that link! Sorry.

@cfreeman
Copy link
Author

cfreeman commented Sep 9, 2014

As someone who has been bumbling around, I have found the documentation quite fragmented and difficult to get a toe-hold on. I'm sure much of this can be put down to my inexperience with the npm/node ecosystem, and I completely agree with not duplicating information.

I think a beefier documentation presence on rtc.io itself would be a welcome addition in helping get started (especially if it was generated from/included everything from github docs and had some higher order glue that showed how the various modules piece together). If I can help with anything on this front, just lemme know.

@DamonOehlman
Copy link
Member

Completely agree Clinton. We've been slowly trying to do that and have a full redux of the rtc.io site planned to address this.

Unfortunately, I'm completely tainted by the node / browserify ecosystem so like to document things at a package level, but we've now got others on the team now that are helping us bridge the gap to the untainted :)

@silviapfeiffer
Copy link
Member

It's somewhat there on http://rtc.io/modules.html, but I agree it's fragmented. We should probably pull the information together without having to do click-throughs.

@cfreeman
Copy link
Author

cfreeman commented Sep 9, 2014

I agree that it is probably just a navigation thing (or my inexperience), once I find what I'm looking for it is outstanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants