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

Datachannels #6

Closed
thammi opened this issue Nov 23, 2014 · 1 comment
Closed

Datachannels #6

thammi opened this issue Nov 23, 2014 · 1 comment

Comments

@thammi
Copy link
Member

thammi commented Nov 23, 2014

Issue by thammi
Thursday Sep 04, 2014 at 19:43 GMT
Originally opened as palavatv/palava-client#9


I started a branch with DataChannel support. I am not sure whether the API is the best approach.

To create a session with one TCP-like DataChannel with the label chat do something like this:

session = new palava.Session
  roomId: room
  channel: channel
  dataChannels: {"chat": {ordered: true}}

session.on 'peer_channel_ready', (peer, name, channel) ->
  if name == 'chat'
    channel.on 'message', (data) ->
      console.log "Incoming chat message:", data

    channel.on 'close', () ->
      console.log "DataChannel closed"

    chat.send "Hello World!"

The configuration could also be moved to Session.init().


thammi included the following code: https://github.com/palavatv/palava-client/pull/9/commits

@thammi
Copy link
Member Author

thammi commented Jan 5, 2015

Was merged.

@thammi thammi closed this as completed Jan 5, 2015
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

1 participant