Skip to content
uistler edited this page Apr 10, 2013 · 1 revision

Events

recive_code

Recived some data from room. Passed arguments in callback:

data {Object} - data

session_id {string} - unique session id.

members_list

Recived members list from server. Passed arguments in callback:

list {array} - list of member data which sent by other members

session_id {string} - unique session id.

on

New member entered in room. Passed arguments in callback:

member_data {Object} - new member identification data

session_id {string} - unique session id.

off

Member in room disconnected. Passed arguments in callback:

member_data {Object} - disconnected member identification data

session_id {string} - unique session id.

Public methods

sendCode(code, session_id)

Sends data in room. code - data to send session - room session id. All others room members will get "recive_code" event.

setSession(app_id, session_id)

Sets main app ID and session ID

addSession (session_id,member_data)

session_id {string} - session name member_data {Object} - client identification data

Connect to additional session. If passed member_data starts listing other joins and disconnects. Notifies other members about new member. Runs "on" event on other clients.

removeSession(session_id,member_data)

session_id {string} - session name

Disconnect from session. Stop listing room events.

If passed member_data: Notifies other members about disconnect. Runs "off" event on other clients.

on(event, callback), off(event), trig(event)

Simple event emitter methods.

Public properties

...