new pub()
The public object which is returned by the EasyRTC listen() function. Contains all public methods for interacting with EasyRTC server.
- Source:
- easyrtc_public_obj.js, line 24
Classes
Methods
-
<static> app(appName, callback)
-
Contains the methods for interfacing with an EasyRTC application. The callback will receive an application object upon successful retrieval of application. The callback may receive an Error object if unsuccessful. Depending on the severity, known errors have an "instanceof" ApplicationWarning or ApplicationError. The function does return an application object which is useful for chaining, however the callback approach is safer and provides additional information in the event of an error.
Parameters:
Name Type Argument Description appName
string <nullable>
Application name which uniquely identifies it on the server. Uses default application if null. callback
appCallback <optional>
Callback with error and application object - Source:
- easyrtc_public_obj.js, line 1097
-
<static> createApp(appName, options, callback)
-
Creates a new EasyRTC application with default values. If a callback is provided, it will receive the new application object. The callback may receive an Error object if unsuccessful. Depending on the severity, known errors have an "instanceof" ApplicationWarning or ApplicationError.
Parameters:
Name Type Argument Description appName
string Application name which uniquely identifies it on the server. options
object <nullable>
Options object with options to apply to the application. May be null. callback
appCallback <optional>
Callback with error and application object - Source:
- easyrtc_public_obj.js, line 1001
-
<static> getAppNames(callback)
-
Sends an array of all application names to a callback.
Parameters:
Name Type Description callback
function(Error, Array.<string>) Callback with error and array containing all application names. - Source:
- easyrtc_public_obj.js, line 50
-
<static> getAppWithEasyrtcid(easyrtcid, callback)
-
Gets app object for application which has an authenticated client with a given easyrtcid
Parameters:
Name Type Description easyrtcid
String Unique identifier for an EasyRTC connection. callback
function(?Error, Object=) Callback with error and application object - Source:
- easyrtc_public_obj.js, line 65
-
<static> getConnectionWithEasyrtcid(easyrtcid, callback)
-
Gets connection object for connection which has an authenticated client with a given easyrtcid
Parameters:
Name Type Description easyrtcid
string EasyRTC unique identifier for a socket connection. callback
function(?Error, Object=) Callback with error and connection object - Source:
- easyrtc_public_obj.js, line 83
-
<static> getOption(optionName) → {*}
-
Gets individual option value. The option value returned is for the server level. Note that some options can be set at the application or room level. If an option has not been set at the room level, it will check to see if it has been set at the application level, if not it will revert to the server level.
Parameters:
Name Type Description optionName
String Option name - Source:
- easyrtc_public_obj.js, line 109
Returns:
Option value (can be any JSON type)- Type
- *
-
<static> getVersion() → {string}
-
Gets EasyRTC Version. The format is in a major.minor.patch format with an optional letter following denoting alpha or beta status. The version is retrieved from the package.json file located in the EasyRTC project root folder.
- Source:
- easyrtc_public_obj.js, line 123
Returns:
EasyRTC Version- Type
- string
-
<static> isApp(appName, callback)
-
Determine if a given application name has been defined.
Parameters:
Name Type Description appName
string Application name which uniquely identifies it on the server. callback
function(?Error, boolean) Callback with error and boolean of whether application is defined. - Source:
- easyrtc_public_obj.js, line 987
-
<static> setOption(optionName, optionValue) → {Boolean}
-
Sets individual option. The option value set is for the server level. Note that some options can be set at the application or room level. If an option has not been set at the room level, it will check to see if it has been set at the application level, if not it will revert to the server level.
Parameters:
Name Type Description optionName
Object Option name optionValue
Object Option value - Source:
- easyrtc_public_obj.js, line 148
Returns:
true on success, false on failure- Type
- Boolean