-
Notifications
You must be signed in to change notification settings - Fork 62
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
A little bit more accurate data channel example #8
Comments
@nnseva Thanks for reporting, agreed the current example doesn't properly cater for multiple participants. I believe it was designed though to be something that people could get started with very simply. My thinking is that this example should remain without the channel registry (limited to a single channel) and we bring in a second example that shows how to work with multiple participants and we also include a NOTE on this example exampling the limitation of the example. I'd also suggest we remove the additional data channel creation args (orderd, maxRetransmits) as introducing those concepts here are probably not helpful for communicating a "My First Data Channel" example... Interested in @cathylill and @silviapfeiffer's thoughts here also... |
Sounds good! Thanks for the feedback! |
Yes, it should be done as minimum to avoid example misunderstanding by newbies. |
@nnseva I'm thinking about moving the majority of examples for this top level RTC package to using something like jsbin. I've converted the example you implemented into the following jsbin sample which I will include in the rtc README: |
I don't understand the example at all. The result was just a blank textarea and nothing else. Where should I get start ? |
@meepeek just open this into two different browser, type into that textarea, see the output |
The data channel example shown in the tutorial http://rtc.io/tutorial-rtc-text-chat.html has some inaccurate code which causes wrong example behaviour in case of 3 or more nodes in the chat. Particularly, when the second channel is created, the message.onkeyup function which was initialized before, is reinitialized by the just created function:
Such a bug in the tutorial makes imaging of your RTC package worse.
I suggest the following a little bit more precise code to replace a tutorial code. This code creates a channel registry which is updated by two different session channel-related events, and allows to create as many nodes in the chat, as simultaneous channels allowed in the RTC implementation.
The text was updated successfully, but these errors were encountered: