new roomObj()
EasyRTC Room Object. Contains methods for handling a specific room including determining which connections have joined.
- Source:
- easyrtc_public_obj.js, line 2631
Members
-
<static> roomObj.events
-
Expose all event functions
- Source:
- easyrtc_public_obj.js, line 2645
-
<static> roomObj.util
-
Expose all utility functions
- Source:
- easyrtc_public_obj.js, line 2653
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:
- easyrtc_public_obj.js, line 2662
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:
- easyrtc_public_obj.js, line 2673
Returns:
The application name- Type
- string
-
<static> roomObj.getConnectionObjects(callback)
-
Returns an array containing the connectionObjs of all connected clients within the room.
Parameters:
Name Type Description callback
function(?Error, Array.<Object>=) Callback with error and array containing connectionObjs. - Source:
- easyrtc_public_obj.js, line 2983
-
<static> roomObj.getConnections(callback)
-
Returns an array containing the easyrtcids of all connected clients within the room.
Parameters:
Name Type Description callback
function(?Error, Array.<string>=) Callback with error and array containing all easyrtcids. - Source:
- easyrtc_public_obj.js, line 2934
-
<static> roomObj.getConnectionWithEasyrtcid(easyrtcid, callback)
-
Returns the connectionObj for a given easyrtcid, but only if it is currently a client in the room
Parameters:
Name Type Description easyrtcid
string EasyRTC unique identifier for a socket connection. callback
function(?Error, Object=) Callback with error and connectionObj. - Source:
- easyrtc_public_obj.js, line 2955
-
<static> roomObj.getField(fieldName, callback)
-
Returns room level field object for a given field name to a provided callback.
Parameters:
Name Type Description fieldName
string Field name callback
function(?Error, Object=) Callback with error and field object (any type) - Source:
- easyrtc_public_obj.js, line 2751
-
<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(?Error, Object=) Callback with error and object containing field names and values. - Source:
- easyrtc_public_obj.js, line 2809
-
<static> roomObj.getFieldSync(fieldName) → {Object}
-
Returns room level field object for a given field name. If the field is not set, it will return a field value will a null field value. This is a synchronous function, thus may not be available in custom cases where state is not kept in memory.
Parameters:
Name Type Description fieldName
string Field name - Source:
- easyrtc_public_obj.js, line 2773
Returns:
Field object- Type
- Object
-
<static> roomObj.getFieldValueSync(fieldName) → {*}
-
Returns room level field value for a given field name. If the field is not set, it will return a null field value. This is a synchronous function, thus may not be available in custom cases where state is not kept in memory.
Parameters:
Name Type Description fieldName
string Field name - Source:
- easyrtc_public_obj.js, line 2791
Returns:
Field value- Type
- *
-
<static> roomObj.getOption(optionName) → {*}
-
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 optionName
String Option name - Source:
- easyrtc_public_obj.js, line 2835
Returns:
Option value (can be any type)- Type
- *
-
<static> roomObj.getRoomName() → {string}
-
Returns the room name for the current room. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
- Source:
- easyrtc_public_obj.js, line 2684
Returns:
The room name- Type
- string
-
<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:
- easyrtc_public_obj.js, line 2901
-
<static> roomObj.setOption(optionName, optionValue) → {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 optionName
Object Option name optionValue
Object Option value - Source:
- easyrtc_public_obj.js, line 2848
Returns:
true on success, false on failure- Type
- Boolean