new events()
EasyRTC Event handling object which contain most methods for interacting with EasyRTC events. For convenience, this class has also been attached to the application, connection, session, and room classes.
- Source:
- easyrtc_public_obj.js, line 164
Members
-
<static> defaultListeners
-
Map of EasyRTC event listener names to their default functions. This map can be used to run a default function manually.
- Source:
- easyrtc_public_obj.js, line 231
-
<static> emit
-
Expose event listener's emit function.
- Source:
- easyrtc_public_obj.js, line 181
Methods
-
<static> emitDefault(eventName, eventParam)
-
Runs the default EasyRTC listener for a given event.
Parameters:
Name Type Description eventName
string EasyRTC event name. eventParam
* The event parameters - Source:
- easyrtc_public_obj.js, line 190
-
<static> on(eventName, listener)
-
Sets listener for a given EasyRTC event. Only one listener is allowed per event. Any other listeners for an event are removed before adding the new one. See the events documentation for expected listener parameters.
Parameters:
Name Type Description eventName
string Listener name. listener
function Function to be called when listener is fired - Source:
- easyrtc_public_obj.js, line 267
-
<static> removeAllListeners(eventName)
-
Removes all listeners for an event. If there is a default EasyRTC listener, it will be added. If eventName is `null`, all events will be removed than the defaults will be restored.
Parameters:
Name Type Argument Description eventName
string <nullable>
Listener name. If `null`, then all events will be removed. - Source:
- easyrtc_public_obj.js, line 283
-
<static> setDefaultListener(eventName)
-
Resets the listener for a given event to the default listener. Removes other listeners.
Parameters:
Name Type Description eventName
string EasyRTC event name. - Source:
- easyrtc_public_obj.js, line 204
-
<static> setDefaultListeners()
-
Resets the listener for all EasyRTC events to the default listeners. Removes all other listeners.
- Source:
- easyrtc_public_obj.js, line 216