Class: roomObj

.appObj. roomObj

new roomObj()

EasyRTC Room Object. Contains methods for handling a specific room including determining which connections have joined.
Source:

Members

<static> roomObj.events

Expose all event functions
Source:

<static> roomObj.util

Expose all utility functions
Source:

Methods

<static> roomObj.getApp() → {Object}

Returns the application object to which the room belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Source:
Returns:
The application object
Type
Object

<static> roomObj.getAppName() → {string}

Returns the application name for the application to which the room belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Source:
Returns:
The application object
Type
string

<static> roomObj.getConnectionObjects(callback)

Returns an array containing the connectionObj's of all connected clients within the room.
Parameters:
Name Type Description
callback function Callback with error and array containing connectionObj's.
Source:

<static> roomObj.getConnections(callback)

Returns an array containing the easyrtcid's of all connected clients within the room.
Parameters:
Name Type Description
callback function Callback with error and array containing all easyrtcid's.
Source:

<static> roomObj.getField(Field, callback)

Returns room level field object for a given field name.
Parameters:
Name Type Description
Field string name
callback function Callback with error and field value (any type)
Source:

<static> roomObj.getFields(limitToIsShared, callback)

Returns an object containing all field names and values within the room. Can be limited to fields with isShared option set to true.
Parameters:
Name Type Description
limitToIsShared boolean Limits returned fields to those which have the isShared option set to true.
callback function Callback with error and object containing field names and values.
Source:

<static> roomObj.getOption(option) → {*}

Gets individual option value. Will first check if option is defined for the room, else it will revert to the application level option (which will in turn fall back to the global level).
Parameters:
Name Type Description
option String Option name
Source:
Returns:
Option value (can be any type)
Type
*

<static> roomObj.setConnection(easyrtcid, next)

Sets application field value for a given field name. Returns false if field could not be set.
Parameters:
Name Type Description
easyrtcid string EasyRTC unique identifier for a socket connection.
next nextCallback A success callback of form next(err).
Source:

<static> roomObj.setField(fieldName, fieldValue, fieldOption, next)

Sets room field value for a given field name.
Parameters:
Name Type Argument Description
fieldName string Must be formatted according to "fieldNameRegExp" option.
fieldValue Object
fieldOption Object <nullable>
Field options (such as isShared which defaults to false)
next nextCallback <optional>
A success callback of form next(err). Possible err will be instanceof (ApplicationWarning).
Source:

<static> roomObj.setOption(option, value) → {Boolean}

Sets individual option which applies only to this room. Set value to NULL to delete the option (thus reverting to global option)
Parameters:
Name Type Description
option Object Option name
value Object Option value
Source:
Returns:
true on success, false on failure
Type
Boolean