SkylinkEvents
- Description:
Also referenced as
PEER EVENTSSkylinkConstants.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
- Source:
- Since:
- 2.0
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
CANDIDATES_GATHERED
- Description:
Event triggered when all remote ICE candidates gathering has completed and been processed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
CANDIDATE_GENERATION_STATE
- Description:
Event triggered when a Peer connection ICE gathering state has changed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
CANDIDATE_PROCESSING_STATE
- Description:
Event triggered when remote ICE candidate processing state has changed when Peer is using trickle ICE.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
CHANNEL_CLOSE
- Description:
Event triggered when socket connection to Signaling server has closed.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
CHANNEL_ERROR
- Description:
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.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
CHANNEL_MESSAGE
- Description:
Note that this is used only for SDK developer purposes. Event triggered when receiving socket message from the Signaling server.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
CHANNEL_OPEN
- Description:
Event triggered when socket connection to Signaling server has opened.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
CHANNEL_REOPEN
- Description:
[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.
- Source:
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
CHANNEL_RETRY
- Description:
[DEPRECATED] Event triggered when attempting to establish socket connection to Signaling server when failed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
DATA_CHANNEL_STATE
- Description:
Event triggered when a Datachannel connection state has changed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
DATA_TRANSFER_STATE
- Description:
Event triggered when a data transfer state has changed.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
ENCRYPT_SECRETS_UPDATED
- Description:
Event triggered when encrypt secret data is updated.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
GET_CONNECTION_STATUS_STATE_CHANGE
- Description:
Event triggered when
method retrieval state changes.getConnectionStatus
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload/ Properties
|
GET_PEERS_STATE_CHANGE
- Description:
Event triggered when
method retrieval state changes.getPeers
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload Properties
|
HANDSHAKE_PROGRESS
- Description:
Event triggered when a Peer connection establishment state has changed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
ICE_CONNECTION_STATE
- Description:
Learn more about how ICE works in this article here. Event triggered when a Peer connection ICE connection state has changed.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
LOCAL_MEDIA_MUTED
- Description:
Event triggered when
method changes User Streams audio and video tracks muted status.muteStreams
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
MEDIA_ACCESS_ERROR
- Description:
Event triggered when retrieval of Stream failed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
MEDIA_ACCESS_FALLBACK
- Description:
Event triggered when Stream retrieval fallback state has changed.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
MEDIA_ACCESS_REQUIRED
- Description:
Event triggered when retrieval of Stream is required to complete
method request.joinRoom
- Source:
Parameters:
Name | Type | Description |
---|---|---|
detail |
Object | Event's payload. |
MEDIA_ACCESS_STOPPED
- Description:
Event triggered when Stream has stopped streaming.
- Source:
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. |
MEDIA_ACCESS_SUCCESS
- Description:
Event triggered when retrieval of Stream is successful.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object |
Properties
|
ON_INCOMING_DATA
- Description:
Event triggered when receiving completed data transfer from Peer.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
ON_INCOMING_MESSAGE
- Description:
Event triggered when receiving message from Peer.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
ON_INCOMING_SCREEN_STREAM
- Description:
Event triggered when receiving Peer Screenshare Stream.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
ON_INCOMING_STREAM
- Description:
Event triggered when receiving Peer Stream.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
PEER_CONNECTION_STATE
- Description:
Event triggered when a Peer connection session description exchanging state has changed.
Learn more about how ICE works in this article here.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload Properties
|
PEER_JOINED
- Description:
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.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload Properties
|
PEER_LEFT
- Description:
Event triggered when a Peer leaves the room.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
PEER_UPDATED
- Description:
Event triggered when a Peer session information has been updated.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
PERSISTENT_MESSAGE_STATE
- Description:
Event triggered when persistent message state changes.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
READY_STATE_CHANGE
- Description:
Event triggered when
init()
method ready state changes.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
RECORDING_STATE
- Description:
Event triggered when recording session state has changed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
ROOM_LOCK
- Description:
Event triggered when Room locked status has changed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload Properties
|
ROOM_REJOIN
- Description:
Event triggered when
joinRoom
can be re-initiated. This event is preceded byleaveRoom
initiated by the SDK in response to peer connection changing toFAILED
state.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload Properties
|
Returns:
- Type
- SkylinkEvent
RTMP_STATE
- Description:
Event triggered when rtmp session state has changed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
SERVER_PEER_JOINED
- Description:
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. ForP2P
key,PEER JOINED
is the corresponding event.-
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
SERVER_PEER_LEFT
- Description:
Event triggered when a server Peer leaves the room.
- Handling an MCU disconnect using the
serverPeerLeft
event -Reconnection
- Handling an MCU disconnect using the
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload Properties
|
SESSION_DISCONNECT
- Description:
Event triggered when Room session has ended abruptly due to network disconnections.
- Handling a socket disconnect using the
sessionDisconnect
event -Reconnection
- Handling a socket disconnect using the
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
SOCKET_ERROR
- Description:
Event triggered when attempt to establish socket connection to Signaling server has failed.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
STORED_MESSAGES
- Description:
Event triggered when receiving stored messages from the Signaling Server.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
STREAM_ENDED
- Description:
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.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
STREAM_MUTED
- Description:
Event triggered when Peer Stream audio or video tracks has been muted / unmuted.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|
SYSTEM_ACTION
- Description:
Event triggered when Signaling server reaction state has changed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detail |
Object | Event's payload. Properties
|