Class SIPml.EventTarget
Defined in: SIPml.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
addEventListener(type, listener)
Adds an event listener to the target object.
|
|
removeEventListener(type)
Removes an event listener from the target object.
|
Method Detail
addEventListener(type, listener)
Adds an event listener to the target object.
Target classes | Supported event types | Raised event object | Remarques |
SIPml.Stack |
* starting started stopping stopped failed_to_start failed_to_stop i_new_call i_new_message m_permission_requested m_permission_accepted m_permission_refused |
SIPml.Stack.Event | '*' is used to listen for all events |
SIPml.Session | * connecting connected terminating terminated i_ao_request media_added media_removed i_request o_request cancelled_request sent_request transport_error global_error message_error webrtc_error |
SIPml.Session.Event | '*' is used to listen for all events |
SIPml.Session.Call |
m_early_media m_local_hold_ok m_local_hold_nok m_local_resume_ok m_local_resume_nok m_remote_hold m_remote_resume m_stream_video_local_added m_stream_video_local_removed m_stream_video_remote_added m_stream_video_remote_removed m_stream_audio_local_added m_stream_audio_local_removed m_stream_audio_remote_added m_stream_audio_remote_removed i_ect_new_call o_ect_trying o_ect_accepted o_ect_completed i_ect_completed o_ect_failed i_ect_failed o_ect_notify i_ect_notify i_ect_requested m_bfcp_info i_info |
SIPml.Session.Event | borrows all events supported by SIPml.Session |
SIPml.Session.Subscribe | i_notify | SIPml.Session.Event | borrows all events supported by SIPml.Session |
// listen for a single event this.addEventListener('started', function(e){ console.info("'started' event fired"); }); // or listen for two or more events this.addEventListener(['started', 'stopped'], function(e){ console.info("'"+e.type+"' event fired"); }); // or listen for all events this.addEventListener('*', function(e){ console.info("'"+e.type+"' event fired"); });
- Parameters:
- {String|Array} type
- The event type/identifier. Must not be null or empty. Use '*' to listen for all events.
- {function} listener
- The object that receives a notification when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function.
- Throws:
- {ERR_INVALID_PARAMETER_VALUE|ERR_INVALID_PARAMETER_TYPE}
- ERR_INVALID_PARAMETER_VALUE | ERR_INVALID_PARAMETER_TYPE
- See:
- removeEventListener
removeEventListener(type)
Removes an event listener from the target object.
- Parameters:
- {String} type
- The event type/identifier to stop listening for.
- See:
- addEventListener