new roomObj()
EasyRTC Room Object. Contains methods for handling a specific room including determining which connections have joined.
- Source:
- easyrtc_public_obj.js, line 2395
Members
-
<static> roomObj.events
-
Expose all event functions
- Source:
- easyrtc_public_obj.js, line 2409
-
<static> roomObj.util
-
Expose all utility functions
- Source:
- easyrtc_public_obj.js, line 2417
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 2426
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 2437
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 callbackfunction(Error, Array.<Object>) Callback with error and array containing connectionObj's. - Source:
- easyrtc_public_obj.js, line 2629
-
<static> roomObj.getConnections(callback)
-
Returns an array containing the easyrtcid's of all connected clients within the room.
Parameters:
Name Type Description callbackfunction(Error, Array.<string>) Callback with error and array containing all easyrtcid's. - Source:
- easyrtc_public_obj.js, line 2614
-
<static> roomObj.getField(Field, callback)
-
Returns room level field object for a given field name.
Parameters:
Name Type Description Fieldstring name callbackfunction(Error, Object) Callback with error and field value (any type) - Source:
- easyrtc_public_obj.js, line 2493
-
<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 limitToIsSharedboolean Limits returned fields to those which have the isShared option set to true. callbackfunction(Error, object) Callback with error and object containing field names and values. - Source:
- easyrtc_public_obj.js, line 2510
-
<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 optionString Option name - Source:
- easyrtc_public_obj.js, line 2531
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 easyrtcidstring EasyRTC unique identifier for a socket connection. nextnextCallback A success callback of form next(err). - Source:
- easyrtc_public_obj.js, line 2571
-
<static> roomObj.setField(fieldName, fieldValue, fieldOption, next)
-
Sets room field value for a given field name.
Parameters:
Name Type Argument Description fieldNamestring Must be formatted according to "fieldNameRegExp" option. fieldValueObject fieldOptionObject <nullable>
Field options (such as isShared which defaults to false) nextnextCallback <optional>
A success callback of form next(err). Possible err will be instanceof (ApplicationWarning). - Source:
- easyrtc_public_obj.js, line 2586
-
<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 optionObject Option name valueObject Option value - Source:
- easyrtc_public_obj.js, line 2544
Returns:
true on success, false on failure- Type
- Boolean