Also referenced as SkylinkConstants.EVENTS
PEER_UPDATED
PEER_JOINED
PEER_LEFT
SERVER_PEER_JOINED
SERVER_PEER_LEFT
GET_PEERS_STATE_CHANGE
PEER_CONNECTION_STATE
SESSION_DISCONNECT
GET_CONNECTION_STATUS_STATE_CHANGE
MEDIA_ACCESS_FALLBACK
MEDIA_ACCESS_REQUIRED
MEDIA_ACCESS_STOPPED
MEDIA_ACCESS_SUCCESS
MEDIA_ACCESS_ERROR
RECORDING_STATE
RTMP_STATE
LOCAL_MEDIA_MUTED
- Since:
-
- 2.0
- Source:
Example
Import SkylinkEventManager and SkylinkConstants from 'skylinkjs'
Example 1: Adding a listener
SkylinkEventManager.addEventListener(SkylinkConstants.EVENTS.ON_INCOMING_STREAM, evt => {
const { detail } = evt;
// do something
});
Example 2: Removing a listener
SkylinkEventManager.removeEventListener(SkylinkConstants.EVENTS.ON_INCOMING_STREAM, evt => {
const { detail } = evt;
// do something
});
Events
CANDIDATE_GENERATION_STATE
Event triggered when a Peer connection ICE gathering state has changed.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
CANDIDATE_PROCESSING_STATE
Event triggered when remote ICE candidate processing state has changed when Peer is using trickle ICE.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
CANDIDATES_GATHERED
Event triggered when all remote ICE candidates gathering has completed and been processed.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
CHANNEL_CLOSE
Event triggered when socket connection to Signaling server has closed.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
CHANNEL_ERROR
This may be caused by Javascript errors in the event listener when subscribing to events.
It may be resolved by checking for code errors in your Web App in the event subscribing listener.
Event triggered when socket connection encountered exception.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
CHANNEL_MESSAGE
Note that this is used only for SDK developer purposes. Event triggered when receiving socket message from the Signaling server.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
CHANNEL_OPEN
Event triggered when socket connection to Signaling server has opened.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
CHANNEL_REOPEN
[DEPRECATED] Event triggered when socket connection to Signaling server has re-opened.
This event has been replaced with SESSION_DISCONNECT
. Implementation of reconnecting back to a
room remains the same.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
CHANNEL_RETRY
[DEPRECATED] Event triggered when attempting to establish socket connection to Signaling server when failed.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
DATA_CHANNEL_STATE
Event triggered when a Datachannel connection state has changed.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
DATA_TRANSFER_STATE
Event triggered when a data transfer state has changed.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
ENCRYPT_SECRETS_UPDATED
Event triggered when encrypt secret data is updated.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
GET_CONNECTION_STATUS_STATE_CHANGE
Event triggered when
method
retrieval state changes.getConnectionStatus
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload/ Properties
|
- Source:
GET_PEERS_STATE_CHANGE
Event triggered when
method retrieval state changes.getPeers
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload Properties
|
- Source:
HANDSHAKE_PROGRESS
Event triggered when a Peer connection establishment state has changed.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
ICE_CONNECTION_STATE
Learn more about how ICE works in this article here. Event triggered when a Peer connection ICE connection state has changed.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
LOCAL_MEDIA_MUTED
Event triggered when
method changes User Streams audio and video tracks
muted
status.muteStreams
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
MEDIA_ACCESS_ERROR
Event triggered when retrieval of Stream failed.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
MEDIA_ACCESS_FALLBACK
Event triggered when Stream retrieval fallback state has changed.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
MEDIA_ACCESS_REQUIRED
Event triggered when retrieval of Stream is required to complete
method request.joinRoom
Parameters:
Name | Type | Description |
---|---|---|
detail |
Object |
Event's payload. |
- Source:
MEDIA_ACCESS_STOPPED
Event triggered when Stream has stopped streaming.
Parameters:
Name | Type | Description |
---|---|---|
detail.isScreensharing |
Object |
The flag if event occurred during |
detail.isAudioFallback |
boolean |
The flag if event occurred during retrieval of audio tracks only when |
detail.streamId |
String |
The Stream ID. |
- Source:
MEDIA_ACCESS_SUCCESS
Event triggered when retrieval of Stream is successful.
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Properties
|
- Source:
ON_INCOMING_DATA
Event triggered when receiving completed data transfer from Peer.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
ON_INCOMING_MESSAGE
Event triggered when receiving message from Peer.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
ON_INCOMING_SCREEN_STREAM
Event triggered when receiving Peer Screenshare Stream.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
ON_INCOMING_STREAM
Event triggered when receiving Peer Stream.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
PEER_CONNECTION_STATE
Event triggered when a Peer connection session description exchanging state has changed.
Learn more about how ICE works in this article here.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload Properties
|
- Source:
PEER_JOINED
Event triggered when a Peer joins the room.
PEER_JOINED
event withisSelf=true
indicates that the local peer has successfully joined the room. All call actions should be done after thePEER_JOINED
event is registered. IfMCU
feature is enabled on the appKey,SERVER PEER JOINED
is the corresponding event.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload Properties
|
- Source:
PEER_LEFT
Event triggered when a Peer leaves the room.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
PEER_UPDATED
Event triggered when a Peer session information has been updated.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
PERSISTENT_MESSAGE_STATE
Event triggered when persistent message state changes.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
READY_STATE_CHANGE
Event triggered when init()
method ready state changes.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
RECORDING_STATE
Event triggered when recording session state has changed.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
ROOM_LOCK
Event triggered when Room locked status has changed.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload Properties
|
- Source:
ROOM_REJOIN
Event triggered when joinRoom
can be re-initiated. This event is preceded by leaveRoom
initiated by the
SDK in response to peer connection changing to FAILED
state.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload Properties
|
- Source:
RTMP_STATE
Event triggered when rtmp session state has changed.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
SERVER_PEER_JOINED
Event triggered when a server Peer joins the room.
-
SERVER_PEER_JOINED
event indicates that theMCU
has successfully joined the
room. All call actions should be done after the SERVER_PEER_JOINED
event is registered.
For P2P
key, PEER JOINED
is the
corresponding event.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
SERVER_PEER_LEFT
Event triggered when a server Peer leaves the room.
- Handling an MCU disconnect using the
serverPeerLeft
event -Reconnection
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload Properties
|
- Source:
SESSION_DISCONNECT
Event triggered when Room session has ended abruptly due to network disconnections.
- Handling a socket disconnect using the
sessionDisconnect
event -Reconnection
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
SOCKET_ERROR
Event triggered when attempt to establish socket connection to Signaling server has failed.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
STORED_MESSAGES
Event triggered when receiving stored messages from the Signaling Server.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
STREAM_ENDED
Event triggered when a Peer Stream streaming has stopped. Note that it may not be the currently sent Stream to User, and it also triggers when User leaves the Room for any currently sent Stream to User from Peer.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
STREAM_MUTED
Event triggered when Peer Stream audio or video tracks has been muted / unmuted.
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source:
SYSTEM_ACTION
Event triggered when Signaling server reaction state has changed.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Event's payload. Properties
|
- Source: