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 160
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 227
-
<static> emit
-
Expose event listener's emit function.
- Source:
- easyrtc_public_obj.js, line 177
Methods
-
<static> emitDefault(eventName, eventParam)
-
Runs the default EasyRTC listener for a given event.
Parameters:
Name Type Description eventNamestring EasyRTC event name. eventParam* The event parameters - Source:
- easyrtc_public_obj.js, line 186
-
<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 eventNamestring Listener name. listenerfunction 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 eventNamestring <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 eventNamestring EasyRTC event name. - Source:
- easyrtc_public_obj.js, line 200
-
<static> setDefaultListeners()
-
Resets the listener for all EasyRTC events to the default listeners. Removes all other listeners.
- Source:
- easyrtc_public_obj.js, line 212