Skylink Class   Defined in: source/template/header.js:51      Available since 0.5.0


Prerequisites on using Skylink

Before using any Skylink functionalities, you will need to authenticate your App Key using the init() method.

To manage or create App Keys, you may access the Temasys Console here.

To view the list of supported browsers, visit the list here.

Here are some articles to help you get started:

Here are some demos you may use to aid your development:

You may see the example below in the Constructor tab to have a general idea how event subscription and the ordering of init() and joinRoom() methods should be called.

If you have any issues, you may find answers to your questions in the FAQ section on our support portal, asks questions, request features or raise bug tickets as well.

If you would like to contribute to our Temasys Web SDK codebase, see the contributing README.

See License (Apache 2.0)




  Skylink ()   _ACKProtocolHandler   _addIceCandidate   _addIceCandidateFromQueue   _addIceCandidateToQueue   _addLocalMediaStreams   _addPeer   _answerHandler   _approachEventHandler   _base64ToBlob   _blobToArrayBuffer   _blobToBase64   _byeHandler   _CANCELProtocolHandler   _candidateHandler   _chunkBlobData   _chunkDataURL   _clearAllStoredLogsFn   _closeChannel   _closeDataChannel   _condition   _containsInList   _createDataChannel   _createPeerConnection   _createSocket   _DATAProtocolHandler   _doAnswer   _doOffer   _endOfCandidatesHandler   _enterHandler   _ERRORProtocolHandler   _getCodecsSupport   _getDataChannelBuffer   _getPeerCustomSettings   _getSDPCodecsSupport   _getSDPCommonSupports   _getSDPFingerprint   _getSDPICECandidates   _getSDPMediaSSRC   _getSDPSelectedCodec   _getStoredLogsFn   _getTransferData   _getTransferInfo   _getUserInfo   _handleAuthStats   _handleBandwidthStats   _handleClientStats   _handleDatachannelStats   _handleDatachannelStats   _handleDataTransferTimeoutForPeer   _handleEndedStreams   _handleIceCandidateStats   _handleIceConnectionStats   _handleIceGatheringStats   _handleNegotiationStats   _handleRecordingStats   _handleSDPConnectionSettings   _handleSessionStats   _handleSignalingStats   _initSelectedRoom   _inRoomHandler   _introduceErrorEventHandler   _isLowerThanVersion   _loadInfo   _logFn   _MESSAGEProtocolHandler   _muteAudioEventHandler   _muteStreams   _muteVideoEventHandler   _offerHandler   _onIceCandidate   _onRemoteStreamAdded   _onStreamAccessError   _onStreamAccessSuccess   _openChannel   _parseConnectionStats   _parseInfo   _parseSDPMediaStreamIDs   _parseStreamSettings   _parseStreamTracksInfo   _peerListEventHandler   _postStatsToServer   _printAllStoredLogsFn   _privateMessageHandler   _processDataChannelData   _processSigMessage   _publicMessageHandler   _recordingEventHandler beta   _redirectHandler   _refreshPeerConnection   _removePeer   _removeSDPCodecs   _removeSDPFilteredCandidates   _removeSDPFirefoxH264Pref   _removeSDPREMBPackets   _removeSDPTransportCCPackets   _removeSDPUnknownAptRtx   _removeSDPVideoRotation   _renderSDPOutput   _reportToAPI   _requestServerInfo   _restartHandler   _restartMCUConnection   _restartPeerConnection   _retrieveStats   _roomLockEventHandler   _sendChannelMessage   _sendMessageToDataChannel   _setClientInfoForLogging   _setIceServers   _setLocalAndSendMessage   _setSCTPport   _setSDPBitrate   _setSDPCodec   _setSDPCodecParams   _signalingEndOfCandidates   _startDataTransfer   _startDataTransferToPeer   _stopStreams   _streamEventHandler   _throttle   _trigger   _updateUserEventHandler   _wait   _waitForOpenChannel   _welcomeHandler   _WRQProtocolHandler   acceptDataTransfer   cancelDataTransfer   disableAudio deprecated   disableVideo deprecated   enableAudio deprecated   enableVideo deprecated   generateUUID   getConnectionStatus   getCurrentDataStreamsSession   getCurrentDataTransfers   getPeerCustomSettings   getPeerInfo   getPeers   getPeersDatachannels   getPeersInRoom   getPeersStream   getRecordings beta   getScreenSources   getStreamSources   getUserData   getUserMedia   init   introducePeer   joinRoom   leaveRoom   lockRoom   muteStream   off   on   once   refreshConnection   refreshDatachannel   sendBlobData   sendMessage   sendP2PMessage   sendStream   sendURLData   setDebugMode   setLogLevel   setUserData   shareScreen   startRecording   startStreamingData beta   stopRecording   stopScreen   stopStream   stopStreamingData beta   streamData beta   unlockRoom   SkylinkLogs   SkylinkLogs.clearAllLogs   SkylinkLogs.getLogs   SkylinkLogs.printAllLogs   _appKeyOwner   _autoIntroduce   _bandwidthAdjuster   _BINARY_FILE_SIZE   _binaryChunkType   _channelOpen   _CHUNK_DATAURL_SIZE   _CHUNK_FILE_SIZE   _clientId   _currentCodecSupport   _currentRecordingId beta   _dataChannels   _dataStreams   _dataTransfers   _DC_PROTOCOL_TYPE   _enableDebugMode   _enableDebugStack   _enableDebugTrace   _enableIceRestart   _EVENTS   _gatheredCandidates   _GROUP_MESSAGE_LIST   _hasMCU   _initOptions   _inRoom   _joinRoomManager   _key   _LOG_KEY   _LOG_LEVELS   _logLevel   _MOZ_BINARY_FILE_SIZE   _MOZ_CHUNK_FILE_SIZE   _onceEvents   _parentId   _path   _peerBandwidth   _peerCandidatesQueue   _peerConnectionConfig   _peerConnections   _peerConnStatus   _peerCustomConfigs   _peerEndOfCandidatesCounter   _peerInformations   _peerList   _peerMessagesStamps   _peerPriorityWeight   _peerStats   _printTimestamp   _publishOnly   _readyState   _recordings beta   _recordingStartInterval beta   _retryCounters   _room   _roomLocked   _sdpSessions   _sdpSettings   _selectedRoom   _SIG_MESSAGE_TYPE   _signalingServer   _signalingServerPort   _signalingServerProtocol   _socket   _socketMessageQueue   _socketMessageTimeout   _socketPorts   _socketSession   _socketUseXDR   _storedLogs   _streams   _streamsBandwidthSettings   _streamsDefaultSettings   _streamsMutedSettings   _streamsSession   _streamsStoppedCbs   _timestamp   _user   _userData   _userInfo   _voiceActivityDetection   AUDIO_CODEC   BUNDLE_POLICY   CANDIDATE_GENERATION_STATE   CANDIDATE_PROCESSING_STATE   DATA_CHANNEL_MESSAGE_ERROR   DATA_CHANNEL_STATE   DATA_CHANNEL_TYPE   DATA_STREAM_STATE   DATA_TRANSFER_DATA_TYPE   DATA_TRANSFER_SESSION_TYPE   DATA_TRANSFER_STATE   DATA_TRANSFER_TYPE   DT_PROTOCOL_VERSION   GET_CONNECTION_STATUS_STATE   GET_PEERS_STATE   HANDSHAKE_PROGRESS   ICE_CONNECTION_STATE   INTRODUCE_STATE   isPrivileged   log   LOG_LEVEL   MEDIA_ACCESS_FALLBACK_STATE   MEDIA_SOURCE   PEER_CERTIFICATE   PEER_CONNECTION_STATE   PRIORITY_WEIGHT_SCHEME   READY_STATE_CHANGE   READY_STATE_CHANGE_ERROR   RECORDING_STATE beta   REGIONAL_SERVER   RTCP_MUX_POLICY   SERVER_PEER_TYPE   SM_PROTOCOL_VERSION   SOCKET_ERROR   SOCKET_FALLBACK   STATS_API_VERSION   SYSTEM_ACTION   SYSTEM_ACTION_REASON   TURN_TRANSPORT   VERSION   VIDEO_CODEC   VIDEO_RESOLUTION   candidateGenerationState   candidateProcessingState   candidatesGathered   channelClose   channelError   channelMessage   channelOpen   channelRetry   dataChannelState   dataStreamState beta   dataTransferState   getConnectionStatusStateChange   getPeersStateChange   handshakeProgress   iceConnectionState   incomingData   incomingDataRequest   incomingDataStream beta   incomingDataStreamStarted beta   incomingDataStreamStopped beta   incomingMessage   incomingStream   introduceStateChange   localMediaMuted   mediaAccessError   mediaAccessFallback   mediaAccessRequired   mediaAccessStopped   mediaAccessSuccess   peerConnectionState   peerJoined   peerLeft   peerRestart   peerUpdated   readyStateChange   recordingState beta   roomLock   serverPeerJoined   serverPeerLeft   serverPeerRestart   sessionDisconnect   socketError   streamEnded   streamMuted   systemAction
  Scroll to top

_ACKProtocolHandler

()
private
  Defined in: source/data-transfer.js:2601      Available since 0.5.2

Function that handles the "ACK" data transfer protocol.

Events Sequence:

There is no event sequence for this method.

_addIceCandidate

()
private
  Defined in: source/ice-candidate.js:201      Available since 0.6.16

Function that adds the ICE candidate to Peer connection.

Events Sequence:

There is no event sequence for this method.

_addIceCandidateFromQueue

()
private
  Defined in: source/ice-candidate.js:164      Available since 0.5.2

Function that adds all the Peer connection buffered ICE candidates received. This should be called only after the remote session description is received and set.

Events Sequence:

There is no event sequence for this method.

_addIceCandidateToQueue

()
private
  Defined in: source/ice-candidate.js:139      Available since 0.5.2

Function that buffers the Peer connection ICE candidate when received before remote session description is received and set.

Events Sequence:

There is no event sequence for this method.

_addLocalMediaStreams

()
private
  Defined in: source/stream-media.js:2313      Available since 0.5.2

Function that sets User's Stream to send to Peer connection. Priority for shareScreen() Stream over getUserMedia() Stream.

Events Sequence:

There is no event sequence for this method.

_addPeer

()
private
  Defined in: source/peer-connection.js:1445      Available since 0.5.4

Function that starts the Peer connection session. Remember to remove previous method of reconnection (re-creating the Peer connection - destroy and create connection).

Events Sequence:

There is no event sequence for this method.

_answerHandler

()
private
  Defined in: source/socket-message.js:1706      Available since 0.5.1

Function that handles the "answer" socket message received. See confluence docs for the "answer" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_approachEventHandler

()
private
  Defined in: source/socket-message.js:520      Available since 0.6.1

Function that handles the "approach" socket message received. See confluence docs for the "approach" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_base64ToBlob

()
private
  Defined in: source/data-process.js:1      Available since 0.1.0

Function that converts Base64 string into Blob object. This is referenced from devnull69@stackoverflow.com #6850276.

Events Sequence:

There is no event sequence for this method.

_blobToArrayBuffer

()
private
  Defined in: source/data-process.js:38      Available since 0.1.0

Function that converts a Blob object into ArrayBuffer object.

Events Sequence:

There is no event sequence for this method.

_blobToBase64

()
private
  Defined in: source/data-process.js:21      Available since 0.1.0

Function that converts a Blob object into Base64 string.

Events Sequence:

There is no event sequence for this method.

_byeHandler

()
private
  Defined in: source/socket-message.js:738      Available since 0.1.0

Function that handles the "bye" socket message received. See confluence docs for the "bye" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_CANCELProtocolHandler

()
private
  Defined in: source/data-transfer.js:2775      Available since 0.5.0

Function that handles the "CANCEL" data transfer protocol.

Events Sequence:

There is no event sequence for this method.

_candidateHandler

()
private
  Defined in: source/socket-message.js:1608      Available since 0.5.1

Function that handles the "candidate" socket message received. See confluence docs for the "candidate" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_chunkBlobData

()
private
  Defined in: source/data-process.js:59      Available since 0.5.2

Function that chunks Blob object based on the data chunk size provided. If provided Blob object size is lesser than or equals to the chunk size, it should return an array of length of 1.

Events Sequence:

There is no event sequence for this method.

_chunkDataURL

()
private
  Defined in: source/data-process.js:91      Available since 0.6.1

Function that chunks large string into string chunks based on the data chunk size provided. If provided string length is lesser than or equals to the chunk size, it should return an array of length of 1.

Events Sequence:

There is no event sequence for this method.

_clearAllStoredLogsFn

()
private scoped
  Defined in: source/skylink-debug.js:133      Available since 0.5.5

Function that clears the stored logs.

Events Sequence:

There is no event sequence for this method.

_closeChannel

()
private
  Defined in: source/socket-channel.js:448      Available since 0.5.5

Function that stops the socket connection to the Signaling.

Events Sequence:

There is no event sequence for this method.

_closeDataChannel

()
private
  Defined in: source/data-channel.js:360      Available since 0.1.0

Function that stops the Datachannel connection and removes object references.

Events Sequence:

There is no event sequence for this method.

_condition

()
private
  Defined in: source/skylink-events.js:1494      Available since 0.5.5

Function that checks if the current state condition is met before subscribing event handler to wait for condition to be fulfilled.

Events Sequence:

There is no event sequence for this method.

_containsInList

()
private
  Defined in: source/room-init.js:750      Available since 0.6.27

Function that checks if value is contained in a SDK constant.

Events Sequence:

There is no event sequence for this method.

_createDataChannel

()
private
  Defined in: source/data-channel.js:1      Available since 0.5.5

Function that starts a Datachannel connection with Peer.

Events Sequence:

There is no event sequence for this method.

_createPeerConnection

()
private
  Defined in: source/peer-connection.js:1752      Available since 0.5.1

Function that creates the Peer connection.

Events Sequence:

There is no event sequence for this method.

_createSocket

()
private
  Defined in: source/socket-channel.js:204      Available since 0.5.10

Function that creates and opens a socket connection to the Signaling.

Events Sequence:

There is no event sequence for this method.

_DATAProtocolHandler

()
private
  Defined in: source/data-transfer.js:2824      Available since 0.5.5

Function that handles the data transfer chunk received.

Events Sequence:

There is no event sequence for this method.

_doAnswer

()
private
  Defined in: source/peer-handshake.js:80      Available since 0.1.0

Function that creates the Peer connection answer session description. This comes after receiving and setting the offer session description.

Events Sequence:

There is no event sequence for this method.

_doOffer

()
private
  Defined in: source/peer-handshake.js:1      Available since 0.5.2

Function that creates the Peer connection offer session description.

Events Sequence:

There is no event sequence for this method.

_endOfCandidatesHandler

()
private
  Defined in: source/socket-message.js:480      Available since 0.6.1

Function that handles the "endOfCandidates" socket message received. See confluence docs for the "endOfCandidates" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_enterHandler

()
private
  Defined in: source/socket-message.js:984      Available since 0.5.1

Function that handles the "enter" socket message received. See confluence docs for the "enter" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_ERRORProtocolHandler

()
private
  Defined in: source/data-transfer.js:2724      Available since 0.5.2

Function that handles the "ERROR" data transfer protocol.

Events Sequence:

There is no event sequence for this method.

_getCodecsSupport

()
private
  Defined in: source/stream-sdp.js:697      Available since 0.6.18

Function that retrieves the current list of support codecs.

Events Sequence:

There is no event sequence for this method.

_getDataChannelBuffer

()
private
  Defined in: source/data-channel.js:251      Available since 0.6.18

Function that returns the Datachannel buffer threshold and amount.

Events Sequence:

There is no event sequence for this method.

Returns:

{JSON}

The buffered amount information.


_getPeerCustomSettings

()
private
  Defined in: source/peer-data.js:561      Available since 0.6.21

Function that returns the Peer custom settings.

Events Sequence:

There is no event sequence for this method.

_getSDPCodecsSupport

()
private
  Defined in: source/stream-sdp.js:1321      Available since 0.6.18

Function that parses the current list of supported codecs from session description.

Events Sequence:

There is no event sequence for this method.

_getSDPCommonSupports

()
private
  Defined in: source/stream-sdp.js:1369      Available since 0.6.25

Function that checks if there are any common codecs supported for remote end.

Events Sequence:

There is no event sequence for this method.

_getSDPFingerprint

()
private
  Defined in: source/stream-sdp.js:997      Available since 0.6.18

Function that parses and retrieves the session description fingerprint.

Events Sequence:

There is no event sequence for this method.

_getSDPICECandidates

()
private
  Defined in: source/stream-sdp.js:1229      Available since 0.6.18

Function that parses and retrieves the session description ICE candidates.

Events Sequence:

There is no event sequence for this method.

_getSDPMediaSSRC

()
private
  Defined in: source/stream-sdp.js:1278      Available since 0.6.18

Function that gets each media line SSRCs.

Events Sequence:

There is no event sequence for this method.

_getSDPSelectedCodec

()
private
  Defined in: source/stream-sdp.js:587      Available since 0.6.16

Function that retrieves the session description selected codec.

Events Sequence:

There is no event sequence for this method.

_getStoredLogsFn

()
private scoped
  Defined in: source/skylink-debug.js:112      Available since 0.5.5

Function that gets the stored logs.

Events Sequence:

There is no event sequence for this method.

_getTransferData

()
private
  Defined in: source/data-transfer.js:2155      Available since 0.6.16

Function that returns the compiled data transfer data.

Events Sequence:

There is no event sequence for this method.

_getTransferInfo

()
private
  Defined in: source/data-transfer.js:2073      Available since 0.6.16

Function that returns the data transfer session.

Events Sequence:

There is no event sequence for this method.

_getUserInfo

()
private
  Defined in: source/peer-data.js:687      Available since 0.4.0

Function that returns the User session information to be sent to Peers.

Events Sequence:

There is no event sequence for this method.

_handleAuthStats

()
private
  Defined in: source/skylink-stats.js:78      Available since 0.6.31

Function that handles the posting of app key authentication states.

Events Sequence:

There is no event sequence for this method.

_handleBandwidthStats

()
private
  Defined in: source/skylink-stats.js:243      Available since 0.6.31

Function that handles the posting of peer connection bandwidth information.

Events Sequence:

There is no event sequence for this method.

_handleClientStats

()
private
  Defined in: source/skylink-stats.js:36      Available since 0.6.31

Function that handles the posting of client information.

Events Sequence:

There is no event sequence for this method.

_handleDatachannelStats

()
private
  Defined in: source/skylink-stats.js:423      Available since 0.6.35

Function that handles buffer of stats data

Events Sequence:

There is no event sequence for this method.

_handleDatachannelStats

()
private
  Defined in: source/skylink-stats.js:389      Available since 0.6.31

Function that handles the posting of datachannel states.

Events Sequence:

There is no event sequence for this method.

_handleDataTransferTimeoutForPeer

()
private
  Defined in: source/data-transfer.js:2182      Available since 0.6.16

Function that handles the data transfers sessions timeouts.

Events Sequence:

There is no event sequence for this method.

_handleEndedStreams

()
private
  Defined in: source/stream-media.js:2408      Available since 0.6.16

Function that handles ended streams.

Events Sequence:

There is no event sequence for this method.

_handleIceCandidateStats

()
private
  Defined in: source/skylink-stats.js:167      Available since 0.6.31

Function that handles the posting of peer local/remote ICE candidate processing states.

Events Sequence:

There is no event sequence for this method.

_handleIceConnectionStats

()
private
  Defined in: source/skylink-stats.js:123      Available since 0.6.31

Function that handles the posting of peer ICE connection states.

Events Sequence:

There is no event sequence for this method.

_handleIceGatheringStats

()
private
  Defined in: source/skylink-stats.js:191      Available since 0.6.31

Function that handles the posting of peer local/remote ICE gathering states.

Events Sequence:

There is no event sequence for this method.

_handleNegotiationStats

()
private
  Defined in: source/skylink-stats.js:210      Available since 0.6.31

Function that handles the posting of peer connection negotiation states.

Events Sequence:

There is no event sequence for this method.

_handleRecordingStats

()
private
  Defined in: source/skylink-stats.js:368      Available since 0.6.31

Function that handles the posting of recording states.

Events Sequence:

There is no event sequence for this method.

_handleSDPConnectionSettings

()
private
  Defined in: source/stream-sdp.js:780      Available since 0.6.16

Function that modifies the session description to handle the connection settings. This is experimental and never recommended to end-users.

Events Sequence:

There is no event sequence for this method.

_handleSessionStats

()
private
  Defined in: source/skylink-stats.js:59      Available since 0.6.31

Function that handles the posting of session states.

Events Sequence:

There is no event sequence for this method.

_handleSignalingStats

()
private
  Defined in: source/skylink-stats.js:99      Available since 0.6.31

Function that handles the posting of socket connection states.

Events Sequence:

There is no event sequence for this method.

_initSelectedRoom

()
private
  Defined in: source/room-init.js:1087      Available since 0.5.5

Starts initialising for Room credentials for room name provided in joinRoom() method.

Events Sequence:

There is no event sequence for this method.

_inRoomHandler

()
private
  Defined in: source/socket-message.js:915      Available since 0.1.0

Function that handles the "inRoom" socket message received. See confluence docs for the "inRoom" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_introduceErrorEventHandler

()
private
  Defined in: source/socket-message.js:503      Available since 0.6.1

Function that handles the "introduceError" socket message received. See confluence docs for the "introduceError" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_isLowerThanVersion

()
private
  Defined in: source/socket-message.js:1845      Available since 0.6.16

Function that compares the SM / DT protocol versions to see if it in the version.

Events Sequence:

There is no event sequence for this method.

_loadInfo

()
private
  Defined in: source/room-init.js:974      Available since 0.5.2

Loads and checks the dependencies if they are loaded correctly.

Events Sequence:

There is no event sequence for this method.

_logFn

()
private scoped
  Defined in: source/skylink-debug.js:277      Available since 0.5.5

Function that handles the logs received and prints in the Web Console interface according to the log level set.

Events Sequence:

There is no event sequence for this method.

_MESSAGEProtocolHandler

()
private
  Defined in: source/data-transfer.js:2703      Available since 0.5.2

Function that handles the "MESSAGE" data transfer protocol.

Events Sequence:

There is no event sequence for this method.

_muteAudioEventHandler

()
private
  Defined in: source/socket-message.js:646      Available since 0.2.0

Function that handles the "muteAudioEvent" socket message received. See confluence docs for the "muteAudioEvent" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_muteStreams

()
private
  Defined in: source/stream-media.js:1655      Available since 0.6.15

Function that handles the muting of Stream audio and video tracks.

Events Sequence:

There is no event sequence for this method.

_muteVideoEventHandler

()
private
  Defined in: source/socket-message.js:676      Available since 0.2.0

Function that handles the "muteVideoEvent" socket message received. See confluence docs for the "muteVideoEvent" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_offerHandler

()
private
  Defined in: source/socket-message.js:1492      Available since 0.5.1

Function that handles the "offer" socket message received. See confluence docs for the "offer" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_onIceCandidate

()
private
  Defined in: source/ice-candidate.js:1      Available since 0.1.0

Function that handles the Peer connection gathered ICE candidate to be sent.

Events Sequence:

There is no event sequence for this method.

_onRemoteStreamAdded

()
private
  Defined in: source/stream-media.js:2279      Available since 0.5.2

Function that handles the RTCPeerConnection.onaddstream remote MediaStream received.

Events Sequence:

There is no event sequence for this method.

_onStreamAccessError

()
private
  Defined in: source/stream-media.js:2238      Available since 0.6.15

Function that handles the native navigator.getUserMedia() API failure callback result.

Events Sequence:

There is no event sequence for this method.

_onStreamAccessSuccess

()
private
  Defined in: source/stream-media.js:2089      Available since 0.3.0

Function that handles the native navigator.getUserMedia() API success callback result.

Events Sequence:

There is no event sequence for this method.

_openChannel

()
private
  Defined in: source/socket-channel.js:404      Available since 0.5.5

Function that starts the socket connection to the Signaling. This starts creating the socket connection and called at first not when requiring to fallback.

Events Sequence:

There is no event sequence for this method.

_parseConnectionStats

()
private
  Defined in: source/peer-connection.js:2261      Available since 0.6.16

Function that handles the stats tabulation.

Events Sequence:

There is no event sequence for this method.

_parseInfo

()
private
  Defined in: source/room-init.js:902      Available since 0.5.2

Parses the Room credentials information retrieved from API server.

Events Sequence:

There is no event sequence for this method.

_parseSDPMediaStreamIDs

()
private
  Defined in: source/stream-sdp.js:1182      Available since 0.6.25

Function that parses the session description to get the MediaStream IDs. NOTE: It might not completely accurate if the setRemoteDescription() fails..

Events Sequence:

There is no event sequence for this method.

_parseStreamSettings

()
private
  Defined in: source/stream-media.js:1865      Available since 0.6.15

Function that parses the getUserMedia() settings provided.

Events Sequence:

There is no event sequence for this method.

_parseStreamTracksInfo

()
private
  Defined in: source/stream-media.js:2017      Available since 0.6.31

Function that parses the mediastream tracks for details.

Events Sequence:

There is no event sequence for this method.

_peerListEventHandler

()
private
  Defined in: source/socket-message.js:464      Available since 0.6.1

Function that handles the "peerList" socket message received. See confluence docs for the "peerList" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_postStatsToServer

()
private
  Defined in: source/skylink-stats.js:1      Available since 0.6.31

Function that sends the stats to the API server.

Events Sequence:

There is no event sequence for this method.

_printAllStoredLogsFn

()
private scoped
  Defined in: source/skylink-debug.js:145      Available since 0.5.5

Function that prints in the Web Console interface the stored logs.

Events Sequence:

There is no event sequence for this method.

_privateMessageHandler

()
private
  Defined in: source/socket-message.js:759      Available since 0.4.0

Function that handles the "private" socket message received. See confluence docs for the "private" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_processDataChannelData

()
private
  Defined in: source/data-transfer.js:2273      Available since 0.6.16

Function that handles the data received from Datachannel and routes to the relevant data transfer protocol handler.

Events Sequence:

There is no event sequence for this method.

_processSigMessage

()
private
  Defined in: source/socket-message.js:373      Available since 0.1.0

Function that handles and processes the socket message received.

Events Sequence:

There is no event sequence for this method.

_publicMessageHandler

()
private
  Defined in: source/socket-message.js:781      Available since 0.4.0

Function that handles the "public" socket message received. See confluence docs for the "public" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_recordingEventHandler

( message ,   )
private beta
  Defined in: source/socket-message.js:803      Available since 0.6.16

Handles the RECORDING Protocol message event received from the platform signaling.

Events Sequence:

There is no event sequence for this method.

Parameters:

  • message {JSON}

    The message object received from platform signaling. This should contain the RECORDING payload.

    • url {String}

      The recording URL if mixing has completed.

    • action {String}

      The recording action received.

    • error {String}

      The recording error exception received.


_redirectHandler

()
private
  Defined in: source/socket-message.js:570      Available since 0.5.1

Function that handles the "redirect" socket message received. See confluence docs for the "redirect" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_refreshPeerConnection

()
private
  Defined in: source/peer-connection.js:227      Available since 0.6.15

Function that refresh connections.

Events Sequence:

There is no event sequence for this method.

_removePeer

()
private
  Defined in: source/peer-connection.js:1636      Available since 0.5.5

Function that ends the Peer connection session.

Events Sequence:

There is no event sequence for this method.

_removeSDPCodecs

()
private
  Defined in: source/stream-sdp.js:485      Available since 0.6.16

Function that modifies the session description to remove codecs.

Events Sequence:

There is no event sequence for this method.

_removeSDPFilteredCandidates

()
private
  Defined in: source/stream-sdp.js:655      Available since 0.6.16

Function that modifies the session description to remove non-relay ICE candidates.

Events Sequence:

There is no event sequence for this method.

_removeSDPFirefoxH264Pref

()
private
  Defined in: source/stream-sdp.js:396      Available since 0.5.2

Function that modifies the session description to remove the previous experimental H264 codec that is apparently breaking connections. NOTE: We should perhaps not remove it since H264 is supported?

Events Sequence:

There is no event sequence for this method.

_removeSDPREMBPackets

()
private
  Defined in: source/stream-sdp.js:559      Available since 0.6.16

Function that modifies the session description to remove REMB packets fb.

Events Sequence:

There is no event sequence for this method.

_removeSDPTransportCCPackets

()
private
  Defined in: source/stream-sdp.js:575      Available since 0.6.38

Function that modifies the session description to remove transport-cc packets fb.

Events Sequence:

There is no event sequence for this method.

_removeSDPUnknownAptRtx

()
private
  Defined in: source/stream-sdp.js:426      Available since 0.6.18

Function that modifies the session description to remove apt/rtx lines that does exists.

Events Sequence:

There is no event sequence for this method.

_removeSDPVideoRotation

()
private
  Defined in: source/stream-sdp.js:412      Available since 0.6.38

Function that modifies the session description to remove the urn:3gpp:video-orientation

Events Sequence:

There is no event sequence for this method.

_renderSDPOutput

()
private
  Defined in: source/stream-sdp.js:1034      Available since 0.6.25

Function that modifies the session description to append the MediaStream and MediaStreamTrack IDs that seems to be missing from Firefox answer session description to Chrome connection causing freezes in re-negotiation.

Events Sequence:

There is no event sequence for this method.

_reportToAPI

()
private scoped
  Defined in: source/skylink-debug.js:249      Available since 0.6.35

Function that will send the log to an API endpoint for persistence

Events Sequence:

There is no event sequence for this method.

_requestServerInfo

()
private
  Defined in: source/room-init.js:769      Available since 0.5.2

Starts retrieving Room credentials information from API server.

Events Sequence:

There is no event sequence for this method.

_restartHandler

()
private
  Defined in: source/socket-message.js:1147      Available since 0.5.6

Function that handles the "restart" socket message received. See confluence docs for the "restart" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_restartMCUConnection

()
private
  Defined in: source/peer-connection.js:2112      Available since 0.6.1

Function that handles the _restartPeerConnection scenario for MCU enabled Peer connections. This is implemented currently by making the user leave and join the Room again. The Peer ID will not stay the same though.

Events Sequence:

There is no event sequence for this method.

_restartPeerConnection

()
private
  Defined in: source/peer-connection.js:1484      Available since 0.5.8

Function that re-negotiates a Peer connection. Remember to remove previous method of reconnection (re-creating the Peer connection - destroy and create connection).

Events Sequence:

There is no event sequence for this method.

_retrieveStats

()
private
  Defined in: source/peer-connection.js:584      Available since 0.6.18

Function that retrieves Peer connection stats.

Events Sequence:

There is no event sequence for this method.

_roomLockEventHandler

()
private
  Defined in: source/socket-message.js:631      Available since 0.2.0

Function that handles the "roomLockEvent" socket message received. See confluence docs for the "roomLockEvent" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_sendChannelMessage

()
private
  Defined in: source/socket-channel.js:1      Available since 0.5.8

Function that sends a socket message over the socket connection to the Signaling.

Events Sequence:

There is no event sequence for this method.

_sendMessageToDataChannel

()
private
  Defined in: source/data-channel.js:285      Available since 0.5.2

Function that sends data over the Datachannel connection.

Events Sequence:

There is no event sequence for this method.

_setClientInfoForLogging

()
  Defined in: source/skylink-debug.js:473      Available since 0.5.5

Function that binds the SKylink instance to reportAPI instance and returns a new bound function

Events Sequence:

There is no event sequence for this method.

_setIceServers

()
private
  Defined in: source/ice-connection.js:1      Available since 0.5.4

Function that filters and configures the ICE servers received from Signaling based on the init() configuration and returns the updated list of ICE servers to be used when constructing Peer connection.

Events Sequence:

There is no event sequence for this method.

_setLocalAndSendMessage

()
private
  Defined in: source/peer-handshake.js:144      Available since 0.5.2

Function that sets the local session description and sends to Peer. If trickle ICE is disabled, the local session description will be sent after ICE gathering has been completed.

Events Sequence:

There is no event sequence for this method.

_setSCTPport

()
private
  Defined in: source/stream-sdp.js:1418      Available since 0.6.35

Function adds SCTP port number for Firefox 63.0.3 and above if its missing in the answer from MCU

Events Sequence:

There is no event sequence for this method.

_setSDPBitrate

()
private
  Defined in: source/stream-sdp.js:163      Available since 0.5.10

Function that modifies the session description to limit the maximum sending bandwidth. Setting this may not necessarily work in Firefox.

Events Sequence:

There is no event sequence for this method.

_setSDPCodec

()
private
  Defined in: source/stream-sdp.js:299      Available since 0.6.16

Function that modifies the session description to set the preferred audio/video codec.

Events Sequence:

There is no event sequence for this method.

_setSDPCodecParams

()
private
  Defined in: source/stream-sdp.js:1      Available since 0.6.16

Function that modifies the session description to configure settings for OPUS audio codec.

Events Sequence:

There is no event sequence for this method.

_signalingEndOfCandidates

()
private
  Defined in: source/peer-connection.js:2281      Available since 0.6.16

Function that signals the end-of-candidates flag.

Events Sequence:

There is no event sequence for this method.

_startDataTransfer

()
private
  Defined in: source/data-transfer.js:1526      Available since 0.6.1

Function that starts the data transfer to Peers.

Events Sequence:

There is no event sequence for this method.

_startDataTransferToPeer

()
private
  Defined in: source/data-transfer.js:1787      Available since 0.6.16

Function that starts or listens the data transfer status to Peer. This reacts differently during MCU environment.

Events Sequence:

There is no event sequence for this method.

Returns:

{Boolean}

Returns a Boolean only during MCU environment which flag indicates if Peer requires interop (Use messaging Datachannel connection instead).


_stopStreams

()
private
  Defined in: source/stream-media.js:1713      Available since 0.6.15

Function that handles stopping the Stream streaming.

Events Sequence:

There is no event sequence for this method.

_streamEventHandler

()
private
  Defined in: source/socket-message.js:706      Available since 0.2.0

Function that handles the "stream" socket message received. See confluence docs for the "stream" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_throttle

()
private
  Defined in: source/skylink-events.js:1558      Available since 0.5.8

Function that throttles a method function to prevent multiple invokes over a specified amount of time. Returns a function to be invoked ._throttle(fn, 1000)() to make throttling functionality work.

Events Sequence:

There is no event sequence for this method.

_trigger

()
private
  Defined in: source/skylink-events.js:1441      Available since 0.1.0

Function that triggers an event. The rest of the parameters after the eventName parameter is considered as the event parameter payloads.

Events Sequence:

There is no event sequence for this method.

_updateUserEventHandler

()
private
  Defined in: source/socket-message.js:604      Available since 0.2.0

Function that handles the "updateUserEvent" socket message received. See confluence docs for the "updateUserEvent" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_wait

()
private
  Defined in: source/skylink-events.js:1520      Available since 0.5.5

Function that starts an interval check to wait for a condition to be resolved.

Events Sequence:

There is no event sequence for this method.

_waitForOpenChannel

()
private
  Defined in: source/room-connection.js:668      Available since 0.5.5

Function that waits for Socket connection to Signaling to be opened.

Events Sequence:

There is no event sequence for this method.

_welcomeHandler

()
private
  Defined in: source/socket-message.js:1312      Available since 0.5.4

Function that handles the "welcome" socket message received. See confluence docs for the "welcome" expected properties to be received based on the current SM_PROTOCOL_VERSION.

Events Sequence:

There is no event sequence for this method.

_WRQProtocolHandler

()
private
  Defined in: source/data-transfer.js:2458      Available since 0.5.2

Function that handles the "WRQ" data transfer protocol.

Events Sequence:

There is no event sequence for this method.

acceptDataTransfer

( peerId ,   transferId ,   [accept=false] ,   )
  Defined in: source/data-transfer.js:388      Available since 0.6.1

Function that accepts or rejects an upload data transfer request from Peer to User.

Example:

        

// Example 1: Accept Peer upload data transfer request skylinkDemo.on("incomingDataRequest", function (transferId, peerId, transferInfo, isSelf) { if (!isSelf) { skylinkDemo.acceptDataTransfer(peerId, transferId, true); } });

// Example 2: Reject Peer upload data transfer request skylinkDemo.on("incomingDataRequest", function (transferId, peerId, transferInfo, isSelf) { if (!isSelf) { skylinkDemo.acceptDataTransfer(peerId, transferId, false); } });

Events Sequence:

Event sequence follows sendBlobData() method after acceptDataTransfer() method is invoked.

Parameters:

  • peerId {String}

    The Peer ID.

  • transferId {String}

    The data transfer ID.

  • accept {Boolean} Optional
    DEFAULT: false

    The flag if User accepts the upload data transfer request from Peer.


cancelDataTransfer

( peerId ,   transferId ,   )
  Defined in: source/data-transfer.js:524      Available since 0.6.1

For MCU enabled Peer connections, the cancel data transfer functionality may differ, as it will result in all Peers related to the data transfer ID to be terminated.
Function that terminates a currently uploading / downloading data transfer from / to Peer.

Example:

        

// Example 1: Cancel Peer data transfer var transferSessions = {};

skylinkDemo.on("dataTransferState", function (state, transferId, peerId) { if ([skylinkDemo.DATA_TRANSFER_STATE.DOWNLOAD_STARTED, skylinkDemo.DATA_TRANSFER_STATE.UPLOAD_STARTED].indexOf(state) > -1) { if (!Array.isArray(transferSessions[transferId])) { transferSessions[transferId] = []; } transferSessions[transferId].push(peerId); } else { transferSessions[transferId].splice(transferSessions[transferId].indexOf(peerId), 1); } });

function cancelTransfer (peerId, transferId) { skylinkDemo.cancelDataTransfer(peerId, transferId); }

Events Sequence:

Event sequence follows sendBlobData() method after cancelDataTransfer() method is invoked.

Parameters:

  • peerId {String}

    The Peer ID.

  • transferId {String}

    The data transfer ID.


disableAudio

()
deprecated
  Defined in: source/stream-media.js:800      Available since 0.5.5

Deprecation Warning! This method has been deprecated. Use muteStream() method instead.
Function that mutes both getUserMedia() Stream and shareScreen() Stream audio tracks.

Example:

        

function muteAudio () { skylinkDemo.disableAudio(); }

Events Sequence:

  1. Invokes muteStream() method with options.audioMuted value as true and options.videoMuted value with current peerInfo.mediaStatus.videoMuted value. See getPeerInfo() method for more information.

disableVideo

()
deprecated
  Defined in: source/stream-media.js:854      Available since 0.5.5

Deprecation Warning! This method has been deprecated. Use muteStream() method instead.
Function that mutes both getUserMedia() Stream and shareScreen() Stream video tracks.

Example:

        

function muteVideo () { skylinkDemo.disableVideo(); }

Events Sequence:

  1. Invokes muteStream() method with options.videoMuted value as true and options.audioMuted value with current peerInfo.mediaStatus.audioMuted value. See getPeerInfo() method for more information.

enableAudio

()
deprecated
  Defined in: source/stream-media.js:773      Available since 0.5.5

Deprecation Warning! This method has been deprecated. Use muteStream() method instead.
Function that unmutes both getUserMedia() Stream and shareScreen() Stream audio tracks.

Example:

        

function unmuteAudio () { skylinkDemo.enableAudio(); }

Events Sequence:

  1. Invokes muteStream() method with options.audioMuted value as false and options.videoMuted value with current peerInfo.mediaStatus.videoMuted value. See getPeerInfo() method for more information.

enableVideo

()
deprecated
  Defined in: source/stream-media.js:827      Available since 0.5.5

Deprecation Warning! This method has been deprecated. Use muteStream() method instead.
Function that unmutes both getUserMedia() Stream and shareScreen() Stream video tracks.

Example:

        

function unmuteVideo () { skylinkDemo.enableVideo(); }

Events Sequence:

  1. Invokes muteStream() method with options.videoMuted value as false and options.audioMuted value with current peerInfo.mediaStatus.audioMuted value. See getPeerInfo() method for more information.

generateUUID

()
  Defined in: source/room-init.js:1      Available since 0.5.9

Function that generates an UUID (Unique ID).

Events Sequence:

There is no event sequence for this method.

Returns:

{String}

Returns a generated UUID (Unique ID).


getConnectionStatus

( [targetPeerId] ,   [callback] ,   )
  Defined in: source/peer-connection.js:313      Available since 0.6.14

Note that this is not well supported in the Edge browser.
Function that retrieves Peer connection bandwidth and ICE connection stats.

Example:

        

// Example 1: Retrieve a Peer connection stats function startBWStatsInterval (peerId) { setInterval(function () { skylinkDemo.getConnectionStatus(peerId, function (error, success) { if (error) return; var sendVideoBytes = success.connectionStats[peerId].video.sending.bytes; var sendAudioBytes = success.connectionStats[peerId].audio.sending.bytes; var recvVideoBytes = success.connectionStats[peerId].video.receiving.bytes; var recvAudioBytes = success.connectionStats[peerId].audio.receiving.bytes; var localCandidate = success.connectionStats[peerId].selectedCandidate.local; var remoteCandidate = success.connectionStats[peerId].selectedCandidate.remote; console.log("Sending audio (" + sendAudioBytes + "bps) video (" + sendVideoBytes + ")"); console.log("Receiving audio (" + recvAudioBytes + "bps) video (" + recvVideoBytes + ")"); console.log("Local candidate: " + localCandidate.ipAddress + ":" + localCandidate.portNumber + "?transport=" + localCandidate.transport + " (type: " + localCandidate.candidateType + ")"); console.log("Remote candidate: " + remoteCandidate.ipAddress + ":" + remoteCandidate.portNumber + "?transport=" + remoteCandidate.transport + " (type: " + remoteCandidate.candidateType + ")"); }); }, 1000); }

// Example 2: Retrieve a list of Peer connection stats function printConnStats (peerId, data) { if (!data[peerId]) return; var sendVideoBytes = data[peerId].video.sending.bytes; var sendAudioBytes = data[peerId].audio.sending.bytes; var recvVideoBytes = data[peerId].video.receiving.bytes; var recvAudioBytes = data[peerId].audio.receiving.bytes; var localCandidate = data[peerId].selectedCandidate.local; var remoteCandidate = data[peerId].selectedCandidate.remote; console.log(peerId + " - Sending audio (" + sendAudioBytes + "bps) video (" + sendVideoBytes + ")"); console.log(peerId + " - Receiving audio (" + recvAudioBytes + "bps) video (" + recvVideoBytes + ")"); console.log(peerId + " - Local candidate: " + localCandidate.ipAddress + ":" + localCandidate.portNumber + "?transport=" + localCandidate.transport + " (type: " + localCandidate.candidateType + ")"); console.log(peerId + " - Remote candidate: " + remoteCandidate.ipAddress + ":" + remoteCandidate.portNumber + "?transport=" + remoteCandidate.transport + " (type: " + remoteCandidate.candidateType + ")"); }

function startBWStatsInterval (peerIdA, peerIdB) { setInterval(function () { skylinkDemo.getConnectionStatus([peerIdA, peerIdB], function (error, success) { if (error) { printConnStats(peerIdA, error.connectionStats); printConnStats(peerIdB, error.connectionStats); } else { printConnStats(peerIdA, success.connectionStats); printConnStats(peerIdB, success.connectionStats); } }); }, 1000); }

// Example 3: Retrieve all Peer connection stats function printConnStats (listOfPeers, data) { listOfPeers.forEach(function (peerId) { if (!data[peerId]) return; var sendVideoBytes = data[peerId].video.sending.bytes; var sendAudioBytes = data[peerId].audio.sending.bytes; var recvVideoBytes = data[peerId].video.receiving.bytes; var recvAudioBytes = data[peerId].audio.receiving.bytes; var localCandidate = data[peerId].selectedCandidate.local; var remoteCandidate = data[peerId].selectedCandidate.remote; console.log(peerId + " - Sending audio (" + sendAudioBytes + "bps) video (" + sendVideoBytes + ")"); console.log(peerId + " - Receiving audio (" + recvAudioBytes + "bps) video (" + recvVideoBytes + ")"); console.log(peerId + " - Local candidate: " + localCandidate.ipAddress + ":" + localCandidate.portNumber + "?transport=" + localCandidate.transport + " (type: " + localCandidate.candidateType + ")"); console.log(peerId + " - Remote candidate: " + remoteCandidate.ipAddress + ":" + remoteCandidate.portNumber + "?transport=" + remoteCandidate.transport + " (type: " + remoteCandidate.candidateType + ")"); }); }

function startBWStatsInterval (peerIdA, peerIdB) { setInterval(function () { skylinkDemo.getConnectionStatus(function (error, success) { if (error) { printConnStats(error.listOfPeers, error.connectionStats); } else { printConnStats(success.listOfPeers, success.connectionStats); } }); }, 1000); }

Events Sequence:

  1. Retrieves Peer connection stats for all targeted Peers.
    1. If Peer connection has closed or does not exists: This can be checked with peerConnectionState event triggering parameter payload state as CLOSED for Peer.
      1. getConnectionStatusStateChange event triggers parameter payload state as RETRIEVE_ERROR.
      2. ABORT and return error.
    2. getConnectionStatusStateChange event triggers parameter payload state as RETRIEVING.
    3. Received response from retrieval.
      1. If retrieval was successful:
        1. getConnectionStatusStateChange event triggers parameter payload state as RETRIEVE_SUCCESS.
      2. Else:
        1. getConnectionStatusStateChange event triggers parameter payload state as RETRIEVE_ERROR.

Parameters:

  • targetPeerId {String | Array} Optional

    The target Peer ID to retrieve connection stats from.

    • When provided as an Array, it will retrieve all connection stats from all the Peer IDs provided.
    • When not provided, it will retrieve all connection stats from the currently connected Peers in the Room.
  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the getConnectionStatusStateChange event triggering state parameter payload value as RETRIEVE_SUCCESS for all Peers targeted for request success. [Rel: Skylink.GET_CONNECTION_STATUS_STATE]

    • error {JSON}

      The error result in request. Defined as null when there are no errors in request

      • listOfPeers {Array}
        The list of Peer IDs targeted.
      • retrievalErrors {JSON}
        The list of Peer connection stats retrieval errors.
      • retrievalErrors.#peerId {Error | String}
        The Peer connection stats retrieval error associated with the Peer ID defined in #peerId property. If #peerId value is "self", it means that it is the error when there are no Peer connections to refresh with.
      • connectionStats {JSON}
        The list of Peer connection stats. These are the Peer connection stats that has been managed to be successfully retrieved.
      • connectionStats.#peerId {JSON}
        The Peer connection stats associated with the Peer ID defined in #peerId property. Object signature matches the stats parameter payload received in the getConnectionStatusStateChange event.
    • success {JSON}

      The success result in request. Defined as null when there are errors in request

      • listOfPeers {Array}
        The list of Peer IDs targeted.
      • connectionStats {JSON}
        The list of Peer connection stats.
      • connectionStats.#peerId {JSON}
        The Peer connection stats associated with the Peer ID defined in #peerId property. Object signature matches the stats parameter payload received in the getConnectionStatusStateChange event.

getCurrentDataStreamsSession

()
  Defined in: source/peer-data.js:487      Available since 0.6.18

Function that gets the list of current data streaming sessions.

Example:

        

// Example 1: Get the list of current data streaming sessions in the same Room var currentDataStreams = skylinkDemo.getCurrentDataStreamsSession();

Events Sequence:

There is no event sequence for this method.

Returns:

{JSON}

The list of Peers Stream.

  • #streamId{JSON}

    The data streaming session.

    • streamInfo{JSON}

      The data streaming information. Object signature matches the streamInfo parameter payload received in the dataStreamState event except without the chunk amd chunkSize property.

    • peerId{String}

      The sender Peer ID.

    • isSelf{Boolean}

      The flag if Peer is User.


getCurrentDataTransfers

()
  Defined in: source/peer-data.js:449      Available since 0.6.18

Function that gets the list of current data transfers.

Example:

        

// Example 1: Get the list of current data transfers in the same Room var currentTransfers = skylinkDemo.getCurrentDataTransfers();

Events Sequence:

There is no event sequence for this method.

Returns:

{JSON}

The list of Peers Stream.

  • #transferId{JSON}

    The data transfer session.

    • transferInfo{JSON}

      The data transfer information. Object signature matches the transferInfo parameter payload received in the dataTransferState event except without the data property.

    • peerId{String}

      The sender Peer ID.

    • isSelf{Boolean}

      The flag if Peer is User.


getPeerCustomSettings

()
  Defined in: source/peer-data.js:531      Available since 0.6.18

Function that gets the list of current custom Peer settings sent and set.

Example:

        

// Example 1: Get the list of current Peer custom settings var currentPeerSettings = skylinkDemo.getPeersCustomSettings();

Events Sequence:

There is no event sequence for this method.

Returns:

{JSON}

The list of Peers custom settings sent and set.

  • #peerId{JSON}

    The Peer settings sent and set.

    • settings{JSON}

      The custom Peer settings. Object signature matches the peerInfo.settings parameter payload received in the peerJoined event.

    • mediaStatus{JSON}

      The custom Peer Stream muted settings. Object signature matches the peerInfo.mediaStatus parameter payload received in the peerJoined event.


getPeerInfo

( [peerId] ,   )
  Defined in: source/peer-data.js:88      Available since 0.4.0

Function that returns the User / Peer current session information.

Example:

        

// Example 1: Get Peer current session information var peerPeerInfo = skylinkDemo.getPeerInfo(peerId);

// Example 2: Get User current session information var userPeerInfo = skylinkDemo.getPeerInfo();

Events Sequence:

There is no event sequence for this method.

Parameters:

  • peerId {String} Optional

    The Peer ID to return the current session information from.

    • When not provided or that the Peer ID is does not exists, it will return the User current session information.

Returns:

{JSON}

The User / Peer current session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.


getPeers

( [showAll=false] ,   [callback] ,   )
  Defined in: source/peer-privileged.js:1      Available since 0.6.1

Note that this feature requires "isPrivileged" flag to be enabled for the App Key provided in the init() method, as only Users connecting using the App Key with this flag enabled (which we call privileged Users / Peers) can retrieve the list of Peer IDs from Rooms within the same App space. Read more about privileged App Key feature here.
Function that retrieves the list of Peer IDs from Rooms within the same App space.

Example:

        

// Example 1: Retrieving the un-privileged Peers skylinkDemo.joinRoom(function (jRError, jRSuccess) { if (jRError) return; skylinkDemo.getPeers(function (error, success) { if (error) return; console.log("The list of only un-privileged Peers in the same App space ->", success); }); });

// Example 2: Retrieving the all Peers (privileged or un-privileged) skylinkDemo.joinRoom(function (jRError, jRSuccess) { if (jRError) return; skylinkDemo.getPeers(true, function (error, success) { if (error) return; console.log("The list of all Peers in the same App space ->", success); }); });

Events Sequence:

  1. If App Key provided in the init() method is not a Privileged enabled Key:
    1. ABORT and return error.
  2. Retrieves the list of Peer IDs from Rooms within the same App space.
    1. getPeersStateChange event triggers parameter payload state value as ENQUIRED.
    2. If received list from Signaling server successfully:
      1. getPeersStateChange event triggers parameter payload state value as RECEIVED.

Parameters:

  • showAll {Boolean} Optional
    DEFAULT: false

    The flag if Signaling server should also return the list of privileged Peer IDs. By default, the Signaling server does not include the list of privileged Peer IDs in the return result.

  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the getPeersStateChange event triggering state parameter payload value as RECEIVED for request success. [Rel: Skylink.GET_PEERS_STATE]

    • error {Error | String}

      The error result in request. Defined as null when there are no errors in request Object signature is the getPeers() error when retrieving list of Peer IDs from Rooms within the same App space.

    • success {JSON}

      The success result in request. Defined as null when there are errors in request Object signature matches the peerList parameter payload received in the getPeersStateChange event.


getPeersDatachannels

()
  Defined in: source/peer-data.js:393      Available since 0.6.18

Function that gets the current list of connected Peers Datachannel connections in the Room.

Example:

        

// Example 1: Get the list of current Peers Datachannels in the same Room var channels = skylinkDemo.getPeersDatachannels();

Events Sequence:

There is no event sequence for this method.

Returns:

{JSON}

The list of Peers Stream.

  • #peerId{JSON}

    The Peer Datachannels information.

    • #channelName{JSON}

      The Datachannel information.

      • channelName{String}

        The Datachannel ID..

        • channelType{String}

          The Datachannel type. [Rel: Skylink.DATA_CHANNEL_TYPE]

        • channelProp{String}

          The Datachannel property.

        • currentTransferId{String}

          The Datachannel connection current progressing transfer session. Defined as null when there is currently no transfer session progressing on the Datachannel connection.

        • currentStreamId{String}

          The Datachannel connection current data streaming session ID. Defined as null when there is currently no data streaming session on the Datachannel connection.

        • readyState{String}

          The Datachannel connection readyState. [Rel: Skylink.DATA_CHANNEL_STATE]

        • bufferedAmountLow{Number}

          The Datachannel buffered amount.

        • bufferedAmountLowThreshold{Number}

          The Datachannel buffered amount threshold.


getPeersInRoom

()
  Defined in: source/peer-data.js:305      Available since 0.6.16

Function that gets the list of connected Peers in the Room.

Example:

        

// Example 1: Get the list of currently connected Peers in the same Room var peers = skylinkDemo.getPeersInRoom();

Events Sequence:

There is no event sequence for this method.

Returns:

{JSON}

The list of connected Peers.

  • #peerId{JSON}

    The Peer information. Object signature matches the peerInfo parameter payload received in the peerJoined event except there is the isSelf flag that determines if Peer is User or not.


getPeersStream

()
  Defined in: source/peer-data.js:336      Available since 0.6.16

Function that gets the list of connected Peers Streams in the Room.

Example:

        

// Example 1: Get the list of current Peers Streams in the same Room var streams = skylinkDemo.getPeersStream();

Events Sequence:

There is no event sequence for this method.

Returns:

{JSON}

The list of Peers Stream.

  • #peerId{JSON}

    The Peer Stream.

    • stream{MediaStream}

      The Stream object.

    • streamId{String}

      The Stream ID.

    • isSelf{Boolean}

      The flag if Peer is User.


getRecordings

()
beta
  Defined in: source/socket-message.js:332      Available since 0.6.16

Note that this feature requires MCU and recording to be enabled for the App Key provided in the init() method. If recording feature is not available to be enabled in the Developer Console, please contact us on our support portal.
Gets the list of current recording sessions since User has connected to the Room.

Example:

        

// Example 1: Get recording sessions skylinkDemo.getRecordings();

Events Sequence:

There is no event sequence for this method.

Returns:

{JSON}

The list of recording sessions.

  • #recordingId{JSON}

    The recording session.

    • active{Boolean}

      The flag that indicates if the recording session is currently active.

    • state{Number}

      The current recording state. [Rel: Skylink.RECORDING_STATE]

    • startedDateTime{String}

      The recording session started DateTime in ISO 8601 format.Note that this value may not be very accurate as this value is recorded when the start event is received.

    • endedDateTime{String}

      The recording session ended DateTime in ISO 8601 format.Note that this value may not be very accurate as this value is recorded when the stop event is received. Defined only after state has triggered STOP.

    • mixingDateTime{String}

      The recording session mixing completed DateTime in ISO 8601 format.Note that this value may not be very accurate as this value is recorded when the mixing completed event is received. Defined only when state is LINK.

    • links{JSON}

      The recording session links. Object signature matches the link parameter payload received in the recordingState event. Defined only when state is LINK.

    • error{Error}

      The recording session error. Defined only when state is ERROR.


getScreenSources

( callback ,   )
  Defined in: source/stream-media.js:1534      Available since 0.6.27

Function that returns the screensharing sources.

Example:

        

// Example 1: Retrieve the list of available shareScreen() sources. skylinkDemo.getScreenSources(function (sources) { skylinkDemo.shareScreen(sources.mediaSource[0] || null); });

// Example 2: Retrieve the list of available shareScreen() sources with a specific item. skylinkDemo.getScreenSources(function (sources) { if (sources.mediaSourceInput[0]) { skylinkDemo.shareScreen({ mediaSource: mediaSourceInput[0].mediaSource, sourceId: mediaSourceInput[0].sourceId }); } else { skylinkDemo.shareScreen(); } });

Events Sequence:

There is no event sequence for this method.

Parameters:

  • callback {Function}

    The callback function fired when request has completed. Function parameters signature is function (success)

    • success {JSON}

      The success result in request. Object signature is the list of sources.

    • success {JSON}

      The list of screensharing media sources and screen sources.

      • mediaSource {Array}
        The array of screensharing media sources.
      • mediaSource.#index {String}
        The screensharing media source item. [Rel: Skylink.MEDIA_SOURCE]
      • mediaSourceInput {Array}
        The list of specific media source screen inputs.
      • mediaSourceInput.#index {JSON}
        The media source screen input item.
      • mediaSourceInput.#index.sourceId {String}
        The screen input item ID.
      • mediaSourceInput.#index.label {String}
        The screen input item label name.
      • mediaSourceInput.#index.mediaSource {String}
        The screen input item media source it belongs to. [Rel: Skylink.MEDIA_SOURCE]

getStreamSources

( callback ,   )
  Defined in: source/stream-media.js:1442      Available since 0.6.27

Function that returns the camera and microphone sources.

Example:

        

// Example 1: Retrieve the getUserMedia() stream with selected source ID. skylinkDemo.getStreamSources(function (sources) { skylinkDemo.getUserMedia({ audio: sources.audio.input[0].deviceId, video: sources.video.input[0].deviceId }); });

// Example 2: Set the output audio speaker (Chrome 49+ supported only) skylinkDemo.getStreamSources(function (sources) { var videoElement = document.getElementById('video'); if (videoElement && typeof videoElement.setSinkId === 'function') { videoElement.setSinkId(sources.audio.output[0].deviceId) } });

Events Sequence:

There is no event sequence for this method.

Parameters:

  • callback {Function}

    The callback function fired when request has completed. Function parameters signature is function (success)

    • success {JSON}

      The success result in request. Object signature is the list of sources.

      • audio {JSON}
        The list of audio input (microphone) and output (speakers) sources.
      • audio.input {Array}
        The list of audio input (microphone) sources.
      • audio.input.#index {JSON}
        The audio input source item.
      • audio.input.#index.deviceId {String}
        The audio input source item device ID.
      • audio.input.#index.label {String}
        The audio input source item device label name.
      • audio.input.#index.groupId {String} Optional
        The audio input source item device physical device ID. Note that there can be different deviceId due to differing sources but can share a groupId because it's the same device.
      • audio.output {Array}
        The list of audio output (speakers) sources.
      • audio.output.#index {JSON}
        The audio output source item. Object signature matches callback.success.audio.input.#index format.
      • video {JSON}
        The list of video input (camera) sources.
      • video.input {Array}
        The list of video input (camera) sources.
      • video.input.#index {JSON}
        The video input source item. Object signature matches callback.success.audio.input.#index format.

getUserData

( [peerId] ,   )
  Defined in: source/peer-data.js:61      Available since 0.5.10

Function that returns the User / Peer current custom data.

Example:

        

// Example 1: Get Peer current custom data var peerUserData = skylinkDemo.getUserData(peerId);

// Example 2: Get User current custom data var userUserData = skylinkDemo.getUserData();

Events Sequence:

There is no event sequence for this method.

Parameters:

  • peerId {String} Optional

    The Peer ID to return the current custom data from.

    • When not provided or that the Peer ID is does not exists, it will return the User current custom data.

Returns:

{JSON | String}

The User / Peer current custom data.


getUserMedia

( [options] ,   [callback] ,   )
  Defined in: source/stream-media.js:1      Available since 0.5.6

For a better user experience, the functionality is throttled when invoked many times in less than the milliseconds interval configured in the init() method.
Function that retrieves camera Stream.

Example:

        

// Example 1: Get both audio and video. skylinkDemo.getUserMedia(function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-video"), success); });

// Example 2: Get only audio. skylinkDemo.getUserMedia({ audio: true }, function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-audio"), success); });

// Example 3: Configure resolution for video skylinkDemo.getUserMedia({ audio: true, video: { resolution: skylinkDemo.VIDEO_RESOLUTION.HD } }, function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-video"), success); });

// Example 4: Configure stereo flag for OPUS codec audio (OPUS is always used by default) skylinkDemo.init({ appKey: "xxxxxx", audioCodec: skylinkDemo.AUDIO_CODEC.OPUS }, function (initErr, initSuccess) { skylinkDemo.getUserMedia({ audio: { stereo: true }, video: true }, function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-video"), success); }); });

// Example 5: Configure frameRate for video skylinkDemo.getUserMedia({ audio: true, video: { frameRate: 50 } }, function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-video"), success); });

// Example 6: Configure video and audio based on selected sources. Does not work for Firefox currently. var sources = { audio: [], video: [] };

function selectStream (audioSourceId, videoSourceId) { if (AdapterJS.webrtcDetectedBrowser === 'firefox') { console.warn("Currently this feature is not supported by Firefox browsers!"); return; } skylinkDemo.getUserMedia({ audio: { optional: [{ sourceId: audioSourceId }] }, video: { optional: [{ sourceId: videoSourceId }] } }, function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-video"), success); }); }

navigator.mediaDevices.enumerateDevices().then(function(devices) { var selectedAudioSourceId = ""; var selectedVideoSourceId = ""; devices.forEach(function(device) { console.log(device.kind + ": " + device.label + " source ID = " + device.deviceId); if (device.kind === "audio") { selectedAudioSourceId = device.deviceId; } else { selectedVideoSourceId = device.deviceId; } }); selectStream(selectedAudioSourceId, selectedVideoSourceId); }).catch(function (error) { console.error("Failed", error); });

Events Sequence:

  1. If options.audio value is false and options.video value is false:
    1. ABORT and return error.
  2. Retrieve camera Stream.
    1. If retrieval was succesful:
      1. If there is any previous getUserMedia() Stream:
        1. Invokes stopStream() method.
      2. If there are missing audio or video tracks requested:
        1. mediaAccessFallback event triggers parameter payload state as FALLBACKED, isScreensharing value as false and isAudioFallback value as false.
      3. Mutes / Unmutes audio and video tracks based on current muted settings in peerInfo.mediaStatus. This can be retrieved with getPeerInfo() method.
      4. mediaAccessSuccess event triggers parameter payload isScreensharing value as false and isAudioFallback value as false.
    2. Else:
      1. If options.audioFallback is enabled in the init() method, options.audio value is true and options.video value is true:
        1. mediaAccessFallback event event triggers parameter payload state as FALLBACKING, isScreensharing value as false and isAudioFallback value as true.
        2. Retrieve camera Stream with audio tracks only.
          1. If retrieval was successful:
            1. If there is any previous getUserMedia() Stream:
              1. Invokes stopStream() method.
            2. mediaAccessFallback event event triggers parameter payload state as FALLBACKED, isScreensharing value as false and isAudioFallback value as true.
            3. Mutes / Unmutes audio and video tracks based on current muted settings in peerInfo.mediaStatus. This can be retrieved with getPeerInfo() method.
            4. mediaAccessSuccess event triggers parameter payload isScreensharing value as false and isAudioFallback value as true.
          2. Else:
            1. mediaAccessError event triggers parameter payload isScreensharing value as false and isAudioFallbackError value as true.
            2. mediaAccessFallback event event triggers parameter payload state as ERROR, isScreensharing value as false and isAudioFallback value as true.
            3. ABORT and return error.
      2. Else:
        1. mediaAccessError event triggers parameter payload isScreensharing value as false and isAudioFallbackError value as false.
        2. ABORT and return error.

Parameters:

  • options {JSON} Optional

    The camera Stream configuration options.

    • When not provided, the value is set to { audio: true, video: true }. To fallback to retrieve audio track only when retrieving of audio and video tracks failed, enable the audioFallback flag in the init() method.
    • useExactConstraints {Boolean} Optional
      DEFAULT: false

      Note that by enabling this flag, exact values will be requested when retrieving camera Stream, but it does not prevent constraints related errors. By default when not enabled, expected mandatory maximum values (or optional values for source ID) will requested to prevent constraints related errors, with an exception for options.video.frameRate option in Safari and IE (any plugin-enabled) browsers, where the expected maximum value will not be requested due to the lack of support.
      The flag if getUserMedia() should request for camera Stream to match exact requested values of options.audio.deviceId and options.video.deviceId, options.video.resolution and options.video.frameRate when provided.

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      Note that the current Edge browser implementation does not support the options.audio.optional, options.audio.deviceId, options.audio.echoCancellation.
      The audio configuration options.

      • stereo {Boolean} Optional
        DEFAULT: false
        Deprecation Warning! This property has been deprecated. Configure this with the options.codecParams.audio.opus.stereo and the options.codecParams.audio.opus["sprop-stereo"] parameter in the init() method instead. If the options.codecParams.audio.opus.stereo or options.codecParams.audio.opus["sprop-stereo"] is configured, this overrides the options.audio.stereo setting.
        The flag if OPUS audio codec stereo band should be configured for sending encoded audio data. When not provided, the default browser configuration is used.
      • usedtx {Boolean} Optional
        Deprecation Warning! This property has been deprecated. Configure this with the options.codecParams.audio.opus.stereo parameter in the init() method instead. If the options.codecParams.audio.opus.stereo is configured, this overrides the options.audio.stereo setting. Note that this feature might not work depending on the browser support and implementation.
        The flag if OPUS audio codec should enable DTX (Discontinuous Transmission) for sending encoded audio data. This might help to reduce bandwidth as it reduces the bitrate during silence or background noise, and goes hand-in-hand with the options.voiceActivityDetection flag in joinRoom() method. When not provided, the default browser configuration is used.
      • useinbandfec {Boolean} Optional
        Deprecation Warning! This property has been deprecated. Configure this with the options.codecParams.audio.opus.useinbandfec parameter in the init() method instead. If the options.codecParams.audio.opus.useinbandfec is configured, this overrides the options.audio.useinbandfec setting. Note that this parameter should only be used for debugging purposes only.
        The flag if OPUS audio codec has the capability to take advantage of the in-band FEC (Forward Error Correction) when sending encoded audio data. This helps to reduce the harm of packet loss by encoding information about the previous packet loss. When not provided, the default browser configuration is used.
      • maxplaybackrate {Number} Optional
        Deprecation Warning! This property has been deprecated. Configure this with the options.codecParams.audio.opus.maxplaybackrate parameter in the init() method instead. If the options.codecParams.audio.opus.maxplaybackrate is configured, this overrides the options.audio.maxplaybackrate setting. Note that this feature might not work depending on the browser support and implementation. Note that this parameter should only be used for debugging purposes only.
        The OPUS audio codec maximum output sampling rate in Hz (hertz) that is is capable of receiving decoded audio data, to adjust to the hardware limitations and ensure that any sending audio data would not encode at a higher sampling rate specified by this. This value must be between 8000 to 48000. When not provided, the default browser configuration is used.
      • mute {Boolean} Optional
        DEFAULT: false The flag if audio tracks should be muted upon receiving them. Providing the value as false does nothing to peerInfo.mediaStatus.audioMuted, but when provided as true, this sets the peerInfo.mediaStatus.audioMuted value to true and mutes any existing shareScreen() Stream audio tracks as well.
      • optional {Array} Optional
        This property has been deprecated. "optional" constraints has been moved from specs.
        Note that this may result in constraints related error when options.useExactConstraints value is true. If you are looking to set the requested source ID of the audio track, use options.audio.deviceId instead.
        The navigator.getUserMedia() API audio: { optional [..] } property.
      • deviceId {String} Optional
        Note this is currently not supported in Firefox browsers.
        The audio track source ID of the device to use. The list of available audio source ID can be retrieved by the navigator.mediaDevices.enumerateDevices API.
      • echoCancellation {Boolean} Optional
        DEFAULT: true
        For Chrome/Opera/IE/Safari/Bowser, the echo cancellation functionality may not work and may produce a terrible feedback. It is recommended to use headphones or other microphone devices rather than the device in-built microphones.
        The flag to enable echo cancellation for audio track.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      Note that the current Edge browser implementation does not support the options.video.optional, options.video.deviceId, options.video.resolution and options.video.frameRate, options.video.facingMode.
      The video configuration options.

      • mute {Boolean} Optional
        DEFAULT: false The flag if video tracks should be muted upon receiving them. Providing the value as false does nothing to peerInfo.mediaStatus.videoMuted, but when provided as true, this sets the peerInfo.mediaStatus.videoMuted value to true and mutes any existing shareScreen() Stream video tracks as well.
      • resolution {JSON} Optional
        The video resolution. By default, VGA resolution option is selected when not provided. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Number | JSON} Optional
        The video resolution width. - When provided as a number, it is the video resolution width. - When provided as a JSON, it is the navigator.mediaDevices.getUserMedia() .width settings. Parameters are "ideal" for ideal resolution width, "exact" for exact video resolution width, "min" for min video resolution width and "max" for max video resolution width. Note that this may result in constraints related errors depending on the browser/hardware supports.
      • resolution.height {Number | JSON} Optional
        The video resolution height. - When provided as a number, it is the video resolution height. - When provided as a JSON, it is the navigator.mediaDevices.getUserMedia() .height settings. Parameters are "ideal" for ideal video resolution height, "exact" for exact video resolution height, "min" for min video resolution height and "max" for max video resolution height. Note that this may result in constraints related errors depending on the browser/hardware supports.
      • frameRate {Number | JSON} Optional
        The video frameRate per second (fps). - When provided as a number, it is the video framerate. - When provided as a JSON, it is the navigator.mediaDevices.getUserMedia() .frameRate settings. Parameters are "ideal" for ideal video framerate, "exact" for exact video framerate, "min" for min video framerate and "max" for max video framerate. Note that this may result in constraints related errors depending on the browser/hardware supports.
      • optional {Array} Optional
        This property has been deprecated. "optional" constraints has been moved from specs.
        Note that this may result in constraints related error when options.useExactConstraints value is true. If you are looking to set the requested source ID of the video track, use options.video.deviceId instead.
        The navigator.getUserMedia() API video: { optional [..] } property.
      • deviceId {String} Optional
        Note this is currently not supported in Firefox browsers.
        The video track source ID of the device to use. The list of available video source ID can be retrieved by the navigator.mediaDevices.enumerateDevices API.
      • facingMode {String | JSON} Optional
        The video camera facing mode. The list of available video source ID can be retrieved by the MediaTrackConstraints facingMode API.
  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the mediaAccessSuccess event triggering isScreensharing parameter payload value as false for request success.

    • error {Error | String}

      The error result in request. Defined as null when there are no errors in request Object signature is the getUserMedia() error when retrieving camera Stream.

    • success {MediaStream}

      The success result in request. Defined as null when there are errors in request Object signature is the camera Stream object.


init

( options ,   [callback] ,   )
  Defined in: source/room-init.js:20      Available since 0.5.5

Function that authenticates and initialises App Key used for Room connections.

Example:

        

// Example 1: Using CORS authentication and connection to default Room skylinkDemo(appKey, function (error, success) { if (error) return; skylinkDemo.joinRoom(); // Goes to default Room });

// Example 2: Using CORS authentication and connection to a different Room skylinkDemo(appKey, function (error, success) { skylinkDemo.joinRoom("testxx"); // Goes to "testxx" Room });

// Example 3: Using credentials authentication and connection to only default Room var defaultRoom = "test", startDateTime = (new Date()).toISOString(), duration = 1, // Allows only User session to stay for 1 hour appKeySecret = "xxxxxxx", hash = CryptoJS.HmacSHA1(defaultRoom + "_" + duration + "_" + startDateTime, appKeySecret); credentials = encodeURIComponent(hash.toString(CryptoJS.enc.Base64));

skylinkDemo({ defaultRoom: defaultRoom, appKey: appKey, credentials: { duration: duration, startDateTime: startDateTime, credentials: credentials } }, function (error, success) { if (error) return; skylinkDemo.joinRoom(); // Goes to default Room (switching to different Room is not allowed for credentials authentication) });

Events Sequence:

  1. If parameter options is not provided:
    1. ABORT and return error.
  2. Checks if dependecies and browser APIs are available.
    1. If AdapterJS is not loaded:
      1. readyStateChange event triggers parameter payload state as ERROR and error.errorCode as ADAPTER_NO_LOADED.
      2. ABORT and return error.
    2. If socket.io-client is not loaded:
      1. readyStateChange event triggers parameter payload state as ERROR and error.errorCode as NO_SOCKET_IO.
      2. ABORT and return error.
    3. If XMLHttpRequest API is not available:
      1. readyStateChange event triggers parameter payload state as ERROR and error.errorCode as NO_XMLHTTPREQUEST_SUPPORT.
      2. ABORT and return error.
    4. If WebRTC is not supported by device:
      1. readyStateChange event triggers parameter payload state as ERROR and error.errorCode as NO_WEBRTC_SUPPORT.
      2. ABORT and return error.
  3. Retrieves Room session token from Auth server.
    1. readyStateChange event triggers parameter payload state as LOADING.
    2. If retrieval was successful:
      1. readyStateChange event triggers parameter payload state as COMPLETED.
    3. Else:
      1. readyStateChange event triggers parameter payload state as ERROR.
      2. ABORT and return error.

Parameters:

  • options {JSON | String}

    The configuration options.

    • When provided as a string, it's configured as options.appKey.
    • appKey {String}

      The App Key. By default, init() uses HTTP CORS authentication. For credentials based authentication, see the options.credentials configuration below. You can know more about the in the authentication methods article here for more details on the various authentication methods. If you are using the Persistent Room feature for scheduled meetings, you will require to use the credential based authentication. See the Persistent Room article here for more information.

    • defaultRoom {String} Optional

      The default Room to connect to when no room parameter is provided in joinRoom() method.

      • When not provided or is provided as an empty string, its value is options.appKey. Note that switching Rooms is not available when using options.credentials based authentication. The Room that User will be connected to is the defaultRoom provided.
    • roomServer {String} Optional

      The Auth server for debugging purposes to use. Note that this is a debugging feature and is only used when instructed for debugging purposes.

    • enableIceTrickle {Boolean} Optional
      DEFAULT: true

      The flag if Peer connections should trickle ICE for faster connectivity.

    • enableStatsGathering {Boolean} Optional
      DEFAULT: true

      Configure the anonymous performance and connectivity statistic collection function. Temasys collects encrypted, anonymous performance and connectivity statistics to allow us to improve performance for our customers and identify regional or ISP specific connectivity issues. This data does not contain any personal information or session content. To enable the configuration of this option, you need to "Collect Quality Statistics" option on the Temasys console Website under App key settings section. The default behavior for this option if not specifically configured is true.

    • enableDataChannel {Boolean} Optional
      DEFAULT: true

      Note that for Edge browsers, this value is overriden as false due to its supports.
      The flag if Datachannel connections should be enabled. This is required to be enabled for sendBlobData() method, sendURLData() method and sendP2PMessage() method.

    • enableTURNServer {Boolean} Optional
      DEFAULT: true

      The flag if TURN ICE servers should be used when constructing Peer connections to allow TURN connections when required and enabled for the App Key.

    • enableSTUNServer {Boolean} Optional
      DEFAULT: true

      The flag if STUN ICE servers should be used when constructing Peer connections to allow TURN connections when required.

    • forceTURN {Boolean} Optional
      DEFAULT: false

      The flag if Peer connections should enforce connections over the TURN server. This overrides options.enableTURNServer value to true and options.enableSTUNServer value to false, options.filterCandidatesType.host value to true, options.filterCandidatesType.srflx value to true and options.filterCandidatesType.relay value to false. Note that currently for MCU enabled Peer connections, the options.filterCandidatesType configuration is not honoured as Peers connected with MCU is similar as a forced TURN connection. The flags will act as if the value is false and ICE candidates will never be filtered regardless of the options.filterCandidatesType configuration.

    • usePublicSTUN {Boolean} Optional
      DEFAULT: false

      The flag if publicly available STUN ICE servers should be used if options.enableSTUNServer is enabled.

    • TURNServerTransport {Boolean} Optional

      Note that configuring the protocol may not necessarily result in the desired network transports protocol used in the actual TURN network traffic as it depends which protocol the browser selects and connects with. This simply configures the TURN ICE server urls query option when constructing the Peer connection. When all protocols are selected, the ICE servers urls are duplicated with all protocols.
      Note that for Edge browsers, this value is overriden as UDP due to its supports.
      The option to configure the ?transport= query parameter in TURN ICE servers when constructing a Peer connections.

      • When not provided, its value is ANY. [Rel: Skylink.TURN_TRANSPORT]
    • disableVideoFecCodecs {Boolean} Optional
      DEFAULT: false

      Note that this is an experimental flag and may cause disruptions in connections or connectivity issues when toggled, and to prevent connectivity issues, these codecs will not be removed for MCU enabled Peer connections.
      The flag if video FEC (Forward Error Correction) codecs like ulpfec and red should be removed in sending session descriptions. This can be useful for debugging purposes to prevent redundancy and overheads in RTP encoding.

    • disableComfortNoiseCodec {Boolean} Optional
      DEFAULT: false

      Note that this is an experimental flag and may cause disruptions in connections or connectivity issues when toggled.
      The flag if audio Comfort Noise (CN) codec should be removed in sending session descriptions. This can be useful for debugging purposes to test preferred audio quality and feedback.

    • disableREMB {Boolean} Optional
      DEFAULT: false

      Note that this is mainly used for debugging purposes and that it is an experimental flag, so it may cause disruptions in connections or connectivity issues when toggled.
      The flag if video REMB feedback packets should be disabled in sending session descriptions.

    • credentials {JSON} Optional

      Note that we strongly recommend developers to return the options.credentials.duration, options.credentials.startDateTime and options.defaultRoom and generate the options.credentials.credentials from a web server as secret shouldn't be exposed on client web app as it poses a security risk itself.
      The credentials used for authenticating App Key with credentials to retrieve the Room session token used for connection in joinRoom() method. Note that switching of Rooms is not allowed when using credentials based authentication, unless init() is invoked again with a different set of credentials followed by invoking the joinRoom() method.

      • startDateTime {String}
        The credentials User session in Room starting DateTime in ISO 8601 format.
      • duration {Number}
        The credentials User session in Room duration in hours.
      • credentials {String}
        The generated credentials used to authenticate the provided App Key with its "secret" property.
        To generate the credentials:
        1. Concatenate a string that consists of the Room name you provide in the options.defaultRoom, the options.credentials.duration and the options.credentials.startDateTime. Example: var concatStr = defaultRoom + "_" + duration + "_" + startDateTime;
        2. Hash the concatenated string with the App Key "secret" property using SHA-1. Example: var hash = CryptoJS.HmacSHA1(concatStr, appKeySecret); See the CryptoJS.HmacSHA1 library.
        3. Encode the hashed string using base64 Example: var b64Str = hash.toString(CryptoJS.enc.Base64); See the CryptoJS.enc.Base64 library.
        4. Encode the base64 encoded string to replace special characters using UTF-8 encoding. Example: var credentials = encodeURIComponent(base64String); See encodeURIComponent() API.
    • audioFallback {Boolean} Optional
      DEFAULT: false

      The flag if getUserMedia() method should fallback to retrieve only audio Stream when retrieving audio and video Stream fails.

    • forceSSL {Boolean} Optional
      DEFAULT: true

      The flag if HTTPS connections should be enforced during request to Auth server and socket connections to Signaling server when accessing window.location.protocol value is "http:". By default, "https:" protocol connections uses HTTPS connections.

    • audioCodec {String | JSON} Optional

      Note that if the audio codec is not supported, the SDK will not configure the local "offer" or "answer" session description to prefer the codec.
      Note that for Edge browsers, this value is set as OPUS due to its supports.
      The option to configure the preferred audio codec to use to encode sending audio data when available for Peer connection.

      • When not provided, its value is AUTO. [Rel: Skylink.AUDIO_CODEC]
      • codec {String}
        The audio codec to prefer to encode sending audio data when available. The value must not be AUTO. [Rel: Skylink.AUDIO_CODEC]
      • samplingRate {Number} Optional
        The audio codec sampling to prefer to encode sending audio data when available.
      • channels {Number} Optional
        The audio codec channels to prefer to encode sending audio data when available.
    • videoCodec {String | JSON} Optional

      Note that if the video codec is not supported, the SDK will not configure the local "offer" or "answer" session description to prefer the codec.
      Note that for Edge browsers, this value is set as H264 due to its supports.
      The option to configure the preferred video codec to use to encode sending video data when available for Peer connection.

      • When not provided, its value is AUTO. [Rel: Skylink.VIDEO_CODEC]
      • codec {String}
        The video codec to prefer to encode sending audio data when available. The value must not be AUTO. [Rel: Skylink.VIDEO_CODEC]
      • samplingRate {Number} Optional
        The video codec sampling to prefer to encode sending video data when available.
    • socketTimeout {Number} Optional
      DEFAULT: 7000

      The timeout for each attempts for socket connection with the Signaling server to indicate that connection has timed out and has failed to establish. Note that the mininum timeout value is 5000. If less, this value will be 5000. Note that it is recommended to use 7000 as the lowest timeout value if Peers are connecting using Polling transports to prevent connection errors.

    • apiTimeout {Number} Optional
      DEFAULT: 4000

      The timeout to wait for response from Auth server.

    • forceTURNSSL {Boolean} Optional
      DEFAULT: false

      Note that currently Firefox does not support the TURNS protocol, and that if TURNS is required, TURN ICE servers using port 443 will be used instead.
      Note that for Edge browsers, this value is overriden as false due to its supports and only port 3478 is used.
      The flag if TURNS protocol should be used when options.enableTURNServer is enabled.

    • filterCandidatesType {JSON} Optional

      Note that this a debugging feature and there might be connectivity issues when toggling these flags.
      The configuration options to filter the type of ICE candidates sent and received.

      • host {Boolean} Optional
        DEFAULT: false The flag if local network ICE candidates should be filtered out.
      • srflx {Boolean} Optional
        DEFAULT: false The flag if STUN ICE candidates should be filtered out.
      • relay {Boolean} Optional
        DEFAULT: false The flag if TURN ICE candidates should be filtered out.
    • throttleIntervals {JSON} Optional

      The configuration options to configure the throttling method timeouts.

      • shareScreen {Number} Optional
        DEFAULT: 10000 The interval timeout for shareScreen() method throttling in milliseconds.
      • getUserMedia {Number} Optional
        DEFAULT: 0 The interval timeout for getUserMedia() method throttling in milliseconds.
      • refreshConnection {Number} Optional
        DEFAULT: 5000
        Note that this throttling is only done for MCU enabled Peer connections with the options.mcuUseRenegoRestart being set to false.
        The interval timeout for refreshConnection() method throttling in milliseconds. Note that there will be no throttling when refreshConnection() method is called internally.
    • throttleShouldThrowError {Boolean} Optional
      DEFAULT: false

      The flag if throttled methods should throw errors when method is invoked less than the interval timeout value configured in options.throttleIntervals.

    • mcuUseRenegoRestart {Boolean} Optional
      DEFAULT: false

      Note that this feature is currently is beta and for any enquiries on enabling and its support, please contact our support portal.
      The flag if refreshConnection() method should renegotiate like non-MCU enabled Peer connection for MCU enabled Peer connections instead of invoking joinRoom() method again.

    • iceServer {String | Array} Optional

      The ICE servers for debugging purposes to use.

      • When defined as string, the value is considered as [options.iceServer]. Note that this is a debugging feature and is only used when instructed for debugging purposes.
      • #index {String} Optional
        The ICE server url for debugging purposes to use.
    • socketServer {String | JSON} Optional

      The Signaling server for debugging purposes to use.

      • When defined as string, the value is considered as { url: options.socketServer }. Note that this is a debugging feature and is only used when instructed for debugging purposes.
      • url {String}
        The Signaling server URL for debugging purposes to use.
      • ports {Array} Optional
        The list of Signaling server ports for debugging purposes to use. If not defined, it will use the default list of ports specified.
      • ports.#index {Number}
        The Signaling server port to fallback and use for debugging purposes.
      • protocol {String} Optional
        The Signaling server protocol for debugging purposes to use. If not defined, it will use the default protocol specified.
    • codecParams {JSON} Optional

      Note that some of these parameters are mainly used for experimental or debugging purposes. Toggling any of these feature may result in disruptions in connectivity.
      The audio and video codecs parameters to configure.

      • video {JSON} Optional
        The video codecs parameters to configure.
      • video.h264 {JSON} Optional
        The H264 video codec parameters to configure.
      • video.h264.profileLevelId {String} Optional
        Note that this parameter should only be used for debugging purposes only.
        The H264 video codec base16 encoded string which indicates the H264 baseline, main, or the extended profiles. When not provided, the default browser configuration is used.
      • video.h264.levelAsymmetryAllowed {Boolean} Optional
        Note that this is an experimental parameter which may result in connectivity issues when toggled.
        The flag if streaming H264 sending video data should be encoded at a different level from receiving video data from Peer encoding to User when Peer is the offerer. If Peer is the offerer instead of the User, the Peer's peerInfo.config.priorityWeight will be higher than User's peerInfo.config.priorityWeight. When not provided, the default browser configuration is used.
      • video.h264.packetizationMode {Number} Optional
        Note that this is an experimental parameter which may result in connectivity issues when enabled. It is advisable to turn off this feature off when receiving H264 decoders do not support the packetization mode, which may result in a blank receiving video stream.
        The flag to enable H264 video codec packetization mode, which splits video frames that are larger for a RTP packet into RTP packet chunks. When not provided, the default browser configuration is used.
      • video.vp8 {JSON} Optional
        The VP8 video codec parameters to configure.
      • video.vp8.maxFr {Number} Optional
        Note that this parameter should only be used for debugging purposes only. Do not toggle this otherwise.
        The maximum number of fps (frames per second) that the VP8 video codec decoder is capable of decoding when receiving encoded video data packets. When not provided, the default browser configuration is used.
      • video.vp8.maxFs {Number} Optional
        Note that this parameter should only be used for debugging purposes only. Do not toggle this otherwise.
        The maximum number of frame size macroblocks that the VP8 video codec decoder is capable of decoding when receiving encoded video data packets. The value has to have the width and height of the frame in macroblocks less than the value of parseInt(Math.sqrt(maxFs * 8)). E.g. If the value is 1200, it is capable of support 640x480 frame width and height, which heights up to 1552px (97 macroblocks value. When not provided, the default browser configuration is used.
      • video.vp9 {JSON} Optional
        The VP9 video codec parameters to configure.
      • video.vp9.maxFr {Number} Optional
        Note that this parameter should only be used for debugging purposes only. Do not toggle this otherwise.
        The maximum number of fps (frames per second) that the VP9 video codec decoder is capable of decoding when receiving encoded video data packets. When not provided, the default browser configuration is used.
      • video.vp9.maxFs {Number} Optional
        Note that this parameter should only be used for debugging purposes only. Do not toggle this otherwise.
        The maximum number of frame size macroblocks that the VP9 video codec decoder is capable of decoding when receiving encoded video data packets. The value has to have the width and height of the frame in macroblocks less than the value of parseInt(Math.sqrt(maxFs * 8)). E.g. If the value is 1200, it is capable of support 640x480 frame width and height, which heights up to 1552px (97 macroblocks value. When not provided, the default browser configuration is used.
      • audio {JSON} Optional
        The audio codecs parameters to configure.
      • audio.opus {JSON} Optional
        Note that this is only applicable to OPUS audio codecs with a sampling rate of 48000 Hz (hertz).
        The OPUS audio codec parameters to configure.
      • audio.opus.stereo {Boolean} Optional
        The flag if OPUS audio codec is able to decode or receive stereo packets. When not provided, the default browser configuration is used.
      • audio.opus.sprop-stereo {Boolean} Optional
        The flag if OPUS audio codec is sending stereo packets. When not provided, the default browser configuration is used.
      • audio.opus.usedtx {Boolean} Optional
        Note that this feature might not work depending on the browser support and implementation.
        The flag if OPUS audio codec should enable DTX (Discontinuous Transmission) for sending encoded audio data. This might help to reduce bandwidth as it reduces the bitrate during silence or background noise, and goes hand-in-hand with the options.voiceActivityDetection flag in joinRoom() method. When not provided, the default browser configuration is used.
      • audio.opus.useinbandfec {Boolean} Optional
        Note that this parameter should only be used for debugging purposes only.
        The flag if OPUS audio codec has the capability to take advantage of the in-band FEC (Forward Error Correction) when sending encoded audio data. This helps to reduce the harm of packet loss by encoding information about the previous packet loss. When not provided, the default browser configuration is used.
      • audio.opus.maxplaybackrate {Number} Optional
        Note that this parameter should only be used for debugging purposes only.
        The OPUS audio codec maximum output sampling rate in Hz (hertz) that is is capable of receiving decoded audio data, to adjust to the hardware limitations and ensure that any sending audio data would not encode at a higher sampling rate specified by this. This value must be between 8000 to 48000. When not provided, the default browser configuration is used.
      • minptime {Number} Optional
        Note that this parameter should only be used for debugging purposes only.
        The OPUS audio codec receiving audio data decoder minimum length of time in milleseconds should be encapsulated in a single received encoded audio data packet. This value must be between 3 to 120 When not provided, the default browser configuration is used.
    • priorityWeightScheme {String} Optional

      Note that this parameter should only be used for debugging purposes only and may not work when internals change.
      The User's priority weight to enforce User as offerer or answerer.

      • When not provided, its value is AUTO. [Rel: Skylink.PRIORITY_WEIGHT_SCHEME]
    • useEdgeWebRTC {Boolean} Optional
      DEFAULT: false

      The flag to use Edge 15.x pre-1.0 WebRTC support.

    • enableSimultaneousTransfers {Boolean} Optional
      DEFAULT: true

      The flag to enable simultaneous data transfers.

  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the readyStateChange event state parameter payload value as COMPLETED for request success. [Rel: Skylink.READY_STATE_CHANGE]

    • error {JSON | String}

      The error result in request.

      • When defined as string, it's the error when required App Key is not provided. Defined as null when there are no errors in request
    • success {JSON}

      The success result in request. Defined as null when there are errors in request

      • serverUrl {String}
        The constructed REST URL requested to Auth server.
      • readyState {Number}
        The current ready state. [Rel: Skylink.READY_STATE_CHANGE]
      • selectedRoom {String}
        The Room based on the current Room session token retrieved for.
      • appKey {String}
        The configured value of the options.appKey.
      • defaultRoom {String}
        The configured value of the options.defaultRoom.
      • roomServer {String}
        The configured value of the options.roomServer.
      • enableIceTrickle {Boolean}
        The configured value of the options.enableIceTrickle.
      • enableDataChannel {Boolean}
        The configured value of the options.enableDataChannel.
      • enableTURNServer {Boolean}
        The configured value of the options.enableTURNServer.
      • enableSTUNServer {Boolean}
        The configured value of the options.enableSTUNServer.
      • TURNTransport {Boolean}
        The configured value of the options.TURNServerTransport.
      • audioFallback {Boolean}
        The configured value of the options.audioFallback.
      • forceSSL {Boolean}
        The configured value of the options.forceSSL.
      • audioCodec {String | JSON}
        The configured value of the options.audioCodec.
      • videoCodec {String | JSON}
        The configured value of the options.videoCodec.
      • socketTimeout {Number}
        The configured value of the options.socketTimeout.
      • apiTimeout {Number}
        The configured value of the options.apiTimeout.
      • forceTURNSSL {Boolean}
        The configured value of the options.forceTURNSSL.
      • forceTURN {Boolean}
        The configured value of the options.forceTURN.
      • usePublicSTUN {Boolean}
        The configured value of the options.usePublicSTUN.
      • disableVideoFecCodecs {Boolean}
        The configured value of the options.disableVideoFecCodecs.
      • disableComfortNoiseCodec {Boolean}
        The configured value of the options.disableComfortNoiseCodec.
      • disableREMB {Boolean}
        The configured value of the options.disableREMB.
      • filterCandidatesType {JSON}
        The configured value of the options.filterCandidatesType.
      • throttleIntervals {JSON}
        The configured value of the options.throttleIntervals.
      • throttleShouldThrowError {Boolean}
        The configured value of the options.throttleShouldThrowError.
      • mcuUseRenegoRestart {JSON}
        The configured value of the options.mcuUseRenegoRestart.
      • iceServer {JSON}
        The configured value of the options.iceServer. See the .urls property in this object for configured value if defined.
      • socketServer {JSON | String}
        The configured value of the options.socketServer.
      • useEdgeWebRTC {Boolean}
        The configured value of the options.useEdgeWebRTC.
      • enableSimultaneousTransfers {Boolean}
        The configured value of the options.enableSimultaneousTransfers.

introducePeer

( sendingPeerId ,   receivingPeerId ,   )
  Defined in: source/peer-privileged.js:94      Available since 0.6.1

Note that this feature requires "isPrivileged" flag to be enabled and "autoIntroduce" flag to be disabled for the App Key provided in the init() method, as only Users connecting using the App Key with this flag enabled (which we call privileged Users / Peers) can retrieve the list of Peer IDs from Rooms within the same App space. Read more about privileged App Key feature here.
Function that selects and introduces a pair of Peers to start connection with each other.

Example:

        

// Example 1: Introduce a pair of Peers skylinkDemo.on("introduceStateChange", function (state, privilegedPeerId, sendingPeerId, receivingPeerId) { if (state === skylinkDemo.INTRODUCE_STATE.INTRODUCING) { console.log("Peer '" + sendingPeerId + "' has been introduced to '" + receivingPeerId + "'"); } });

skylinkDemo.joinRoom(function (jRError, jRSuccess) { if (jRError) return; skylinkDemo.getPeers(function (gPError, gPSuccess) { if (gPError) return; skylinkDemo.introducePeer(gPSuccess.roomName[0], gPSuccess.roomName[1]); }); });

Events Sequence:

  1. If App Key provided in the init() method is not a Privileged enabled Key:
    1. ABORT and return error.
  2. Starts sending introduction request for the selected pair of Peers to the Signaling server.
    1. introduceStateChange event triggers parameter payload state value as INTRODUCING.
    2. If received errors from Signaling server:
      1. introduceStateChange event triggers parameter payload state value as ERROR.

Parameters:

  • sendingPeerId {String}

    The Peer ID to be connected with receivingPeerId.

  • receivingPeerId {String}

    The Peer ID to be connected with sendingPeerId.


joinRoom

( [room] ,   [options] ,   [callback] ,   )
  Defined in: source/room-connection.js:1      Available since 0.5.5

Function that starts the Room session.

Example:

        

// Example 1: Connecting to the default Room without Stream skylinkDemo.joinRoom(function (error, success) { if (error) return; console.log("User connected."); });

// Example 2: Connecting to Room "testxx" with Stream skylinkDemo.joinRoom("testxx", { audio: true, video: true }, function (error, success) { if (error) return; console.log("User connected with getUserMedia() Stream.") });

// Example 3: Connecting to default Room with Stream retrieved earlier skylinkDemo.getUserMedia(function (gUMError, gUMSuccess) { if (gUMError) return; skylinkDemo.joinRoom(function (error, success) { if (error) return; console.log("User connected with getUserMedia() Stream."); }); });

// Example 4: Connecting to "testxx" Room with shareScreen() Stream retrieved manually skylinkDemo.on("mediaAccessRequired", function () { skylinkDemo.shareScreen(function (sSError, sSSuccess) { if (sSError) return; }); });

skylinkDemo.joinRoom("testxx", { manualGetUserMedia: true }, function (error, success) { if (error) return; console.log("User connected with shareScreen() Stream."); });

// Example 5: Connecting to "testxx" Room with User custom data var data = { username: "myusername" }; skylinkDemo.joinRoom("testxx", { userData: data }, function (error, success) { if (error) return; console.log("User connected with correct user data?", success.peerInfo.userData.username === data.username); });

// Example 6: Connecting to "testxx" Room with a pre-configured bandwidth set skylinkDemo.joinRoom("testxx", { bandwidth: skylinkDemo.VIDEO_QUALITY.HD }, function (error, success) { if (error) return; console.log("User connected with bandwidth quality HD"); });

Events Sequence:

  1. If User is in a Room:
    1. Invoke leaveRoom() method to end current Room connection. Invoked leaveRoom() method stopMediaOptions parameter value will be false. Regardless of request errors, joinRoom() will still proceed.
  2. Check if Room name provided matches the Room name of the currently retrieved Room session token.
    1. If Room name does not matches:
      1. Invoke init() method to retrieve new Room session token.
        1. If request has errors:
          1. ABORT and return error.
  3. Open a new socket connection to Signaling server.
    1. If Socket connection fails:
      1. socketError event triggers parameter payload errorCode as CONNECTION_FAILED.
        1. Checks if there are fallback ports and transports to use.
          1. If there are still fallback ports and transports:
            1. Attempts to retry socket connection to Signaling server.
              1. channelRetry event triggers.
              2. socketError event triggers parameter payload errorCode as RECONNECTION_ATTEMPT.
              3. If attempt to retry socket connection to Signaling server has failed:
                1. socketError event triggers parameter payload errorCode as RECONNECTION_FAILED.
                2. Checks if there are still any more fallback ports and transports to use.
                  1. If there are is no more fallback ports and transports to use:
                    1. socketError event triggers parameter payload errorCode as RECONNECTION_ABORTED.
                    2. ABORT and return error.
                  2. Else:
                    1. REPEAT attempt to retry socket connection to Signaling server step.
          2. Else:
            1. socketError event triggers parameter payload errorCode as CONNECTION_ABORTED.
            2. ABORT and return error.
    2. If socket connection to Signaling server has opened:
      1. channelOpen event triggers.
  4. Checks if there is options.manualGetUserMedia requested
    1. If it is requested:
      1. mediaAccessRequired event triggers.
      2. If more than 30 seconds has passed and no getUserMedia() Stream or shareScreen() Stream has been retrieved:
        1. ABORT and return error.
    2. Else:
      1. If there is options.audio or options.video requested:
        1. Invoke getUserMedia() method.
          1. If request has errors:
            1. ABORT and return error.
  5. Starts the Room session
    1. If Room session has started successfully:
      1. peerJoined event triggers parameter payload isSelf value as true.
      2. If MCU is enabled for the App Key provided in init() method and connected:
        1. serverPeerJoined event triggers serverPeerType as MCU. MCU has to be present in the Room in order for Peer connections to commence.
        2. Checks for any available Stream
          1. If shareScreen() Stream is available:
            1. incomingStream event triggers parameter payload isSelf value as true and stream as shareScreen() Stream. User will be sending shareScreen() Stream to Peers.
          2. Else if getUserMedia() Stream is available:
            1. incomingStream event triggers parameter payload isSelf value as true and stream as getUserMedia() Stream. User will be sending getUserMedia() Stream to Peers.
          3. Else:
            1. No Stream will be sent.
    2. Else:
      1. systemAction event triggers parameter payload action as REJECT.
      2. ABORT and return error.

Parameters:

  • room {String} Optional

    The Room name.

    • When not provided or is provided as an empty string, its value is the options.defaultRoom provided in the init() method. Note that if you are using credentials based authentication, you cannot switch the Room that is not the same as the options.defaultRoom defined in the init() method.
  • options {JSON} Optional

    The Room session configuration options.

    • userData {JSON | String} Optional

      The User custom data. This can be set after Room session has started using the setUserData() method.

    • useExactConstraints {Boolean} Optional

      The getUserMedia() method options.useExactConstraints parameter settings. See the options.useExactConstraints parameter in the getUserMedia() method for more information.

    • audio {Boolean | JSON} Optional

      The getUserMedia() method options.audio parameter settings. When value is defined as true or an object, getUserMedia() method to be invoked to retrieve new Stream. If options.video is not defined, it will be defined as false. Object signature matches the options.audio parameter in the getUserMedia() method.

    • video {Boolean | JSON} Optional

      The getUserMedia() method options.video parameter settings. When value is defined as true or an object, getUserMedia() method to be invoked to retrieve new Stream. If options.audio is not defined, it will be defined as false. Object signature matches the options.video parameter in the getUserMedia() method.

    • voiceActivityDetection {Boolean} Optional
      DEFAULT: true

      The flag if voice activity detection should be enabled. This can only be toggled if User is and for the offerer, which is determined if User's peerInfo.config.priorityWeight is higher than Peer's.

      This works hand-in-hand with the options.disableComfortNoiseCodec flag in the init() method and the options.audio.usedtx setting in getUserMedia() method. VAD (voice activity detection) detects if there is an active voice in the Stream, and if there is no active voice in the Stream, the options.audio.usedtx (if enabled) would prevent sending these empty bits. To prevent huge differences when there is a silence and an active voice later, the CN codec would produce an empty voice to make it sound better.

    • bandwidth {JSON} Optional

      Note that this is currently not supported with Firefox browsers versions 48 and below as noted in an existing bugzilla ticket here.
      The configuration to set the maximum streaming bandwidth to send to Peers. You can also use the preconfigured constant VIDEO_QUALITY for recommended values.

      • audio {Number} Optional
        The maximum audio streaming bandwidth sent to Peers in kbps. Recommended values are 50 to 200. 50 is sufficient enough for an audio call. The higher you go if you want clearer audio and to be able to hear music streaming.
      • video {Number} Optional
        The maximum video streaming bandwidth sent to Peers. Recommended values are 256-500 for 180p quality, 500-1024 for 360p quality, 1024-2048 for 720p quality and 2048-4096 for 1080p quality.
      • data {Number} Optional
        The maximum data streaming bandwidth sent to Peers. This affects the P2P messaging in sendP2PMessage() method, and data transfers in sendBlobData() method and sendURLData() method.
    • googleXBandwidth {JSON} Optional

      Note that this is an experimental configuration and may cause disruptions in connections or connectivity issues when toggled, or may not work depending on browser supports. Currently, this only toggles the video codec bandwidth configuration.
      The configuration to set the experimental google video streaming bandwidth sent to Peers. Note that Peers may override the "receive from" streaming bandwidth depending on the Peers configuration.

      • min {Number} Optional
        The minimum experimental google video streaming bandwidth sent to Peers. This toggles the "x-google-min-bitrate" flag in the session description.
      • max {Number} Optional
        The maximum experimental google video streaming bandwidth sent to Peers. This toggles the "x-google-max-bitrate" flag in the session description.
    • manualGetUserMedia {Boolean} Optional

      The flag if joinRoom() should trigger mediaAccessRequired event in which the getUserMedia() Stream or shareScreen() Stream must be retrieved as a requirement before Room session may begin. This ignores the options.audio and options.video configuration. After 30 seconds without any Stream retrieved, this results in the callback(error, ..) result.

    • sdpSettings {JSON} Optional

      Note that this is mainly used for debugging purposes and that it is an experimental flag, so it may cause disruptions in connections or connectivity issues when toggled. Note that it might not work with MCU enabled Peer connections or break MCU enabled Peer connections.
      The configuration to set the session description settings.

      • connection {JSON} Optional
        The configuration to set the session description connection settings. Note that this configuration may disable the media streaming and these settings will be enabled for MCU server Peer connection regardless of the flags configured.
      • connection.audio {Boolean} Optional
        DEFAULT: true The configuration to enable audio session description connection.
      • connection.video {Boolean} Optional
        DEFAULT: true The configuration to enable video session description connection.
      • connection.data {Boolean} Optional
        DEFAULT: true The configuration to enable Datachannel session description connection.
      • direction {JSON} Optional
        The configuration to set the session description connection direction to enable or disable uploading and downloading audio or video media streaming. Note that this configuration does not prevent RTCP packets from being sent and received.
      • direction.audio {JSON} Optional
        The configuration to set the session description connection direction for audio streaming.
      • direction.audio.send {Boolean} Optional
        DEFAULT: true The flag if uploading audio streaming should be enabled when available.
      • direction.audio.receive {Boolean} Optional
        DEFAULT: true The flag if downloading audio streaming should be enabled when available.
      • direction.video {JSON} Optional
        The configuration to set the session description connection direction for video streaming.
      • direction.video.send {Boolean} Optional
        DEFAULT: true The flag if uploading video streaming should be enabled when available.
      • direction.video.receive {Boolean} Optional
        DEFAULT: true The flag if downloading video streaming should be enabled when available.
    • publishOnly {JSON | Boolean} Optional

      For MCU enabled Peer connections, defining this flag would make Peer not know other Peers presence in the Room.
      For non-MCU enable Peer connections, defining this flag would cause other Peers in the Room to not to send Stream to Peer, and overrides the config options.sdpSettings.direction.audio.receive value to false, options.sdpSettings.direction.video.receive value to false, options.sdpSettings.direction.video.send value to true and options.sdpSettings.direction.audio.send value to true.
      Note that this feature is currently is beta, and for any enquiries on enabling and its support for MCU enabled Peer connections, please contact our support portal.

      How does the publish only functionality work? Imagine several Skylink instances like A1, B1, C1 and A1 opening a new instance A2 with publish only enabled with configured A1 as parent.

      MCU enabled roomMCU disabled room
      PresenceStreamPresenceStream
      A1B1, C1B1, C1B1, C1B1, C1
      B1A1, C1, A2A1, C1, A2A1, C1, A2A1, C1, A2
      C1B1, C1, A2B1, C1, A2B1, C1, A2B1, C1, A2
      A2B1, C1
      Parent and child will not receive each other presence and stream because they are related to each other in the same client page, hence no uploading or downloading is required. If A2 did not configure A1 as the parent, A1 will receive A2.
      The config if Peer would publish only.

      • parentId {String} Optional
        Deprecation Warning! This property has been deprecated. Use options.parentId instead.
        The parent Peer ID to match to when Peer is connected. This is useful for identification for users connecting the Room twice simultaneously for multi-streaming. If User Peer ID matches the parent Peer ID provided from Peer, User will not be connected to Peer. Parent will not be connected to (or receive the presence of) child, so will child will not be connected to (or receive the presence of) parent.
    • parentId {String} Optional

      The parent Peer ID to match to when Peer is connected. Note that configuring this value overrides the options.publishOnly.parentId value. This is useful for identification for users connecting the Room twice simultaneously for multi-streaming. If User Peer ID matches the parent Peer ID provided from Peer, User will not be connected to Peer. Parent will not be connected to (or receive the presence of) child, so will child will not be connected to (or receive the presence of) parent.

    • peerConnection {JSON} Optional

      Note that this is mainly used for debugging purposes, so it may cause disruptions in connections or connectivity issues when configured.
      The Peer connection constraints settings.

      • bundlePolicy {String} Optional
        The Peer connection media bundle policy. - When not provided, its value is BALANCED. [Rel: Skylink.BUNDLE_POLICY]
      • rtcpMuxPolicy {String} Optional
        The Peer connection RTP and RTCP ICE candidates mux policy. - When not provided, its value is REQUIRE. [Rel: Skylink.RTCP_MUX_POLICY]
      • iceCandidatePoolSize {Number} Optional
        DEFAULT: 0 The number of ICE candidates to gather before gathering it when setting local offer / answer session description.
      • certificate {String} Optional
        The type of certificate that Peer connection should generate and use when available. - When not provided, its value is AUTO. [Rel: Skylink.PEER_CERTIFICATE]
      • disableBundle {String} Optional
        DEFAULT: false The flag if for each Peer connection instead of bundling all media connections into 1 connection, should have all of them negotiated as different separate media connections.
    • autoBandwidthAdjustment {Boolean | JSON} Optional
      DEFAULT: false

      Note that this is an experimental feature which may be removed or changed in the future releases. This feature is also only available for non-MCU enabled Peer connections and Edge Peer connections.
      The flag if Peer connections uploading and downloading bandwidth should be automatically adjusted each time based on a specified interval. Note this would cause peerRestart event to be triggered for each specified interval.

      • interval {Number} Optional
        DEFAULT: 10 The interval each time to adjust bandwidth connections in seconds. Note that the minimum value is 10.
      • limitAtPercentage {Number} Optional
        DEFAULT: 100 The percentage of the average bandwidth to adjust to. E.g. avgBandwidth * (limitPercentage / 100).
      • useUploadBwOnly {Boolean} Optional
        DEFAULT: false The flag if average bandwidth computation should only consist of the upload bandwidth.
  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the peerJoined event triggering isSelf parameter payload value as true for request success.

    • error {JSON}

      The error result in request. Defined as null when there are no errors in request

      • error {Error}
        The error received when starting Room session has failed.
      • errorCode {Number} Optional
        The current init() method ready state. Defined as null when no init() method has not been called due to invalid configuration. [Rel: Skylink.READY_STATE_CHANGE]
      • room {String}
        The Room name.
    • success {JSON}

      The success result in request. Defined as null when there are errors in request

      • room {String}
        The Room name.
      • peerId {String}
        The User's Room session Peer ID.
      • peerInfo {JSON}
        The User's current Room session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.

leaveRoom

( [stopMediaOptions=true] ,   [callback] ,   )
  Defined in: source/room-connection.js:484      Available since 0.5.5

Note that this method will close any existing socket channel connection despite not being in the Room.
Function that stops Room session.

Events Sequence:

  1. If Socket connection is opened:
    1. channelClose event triggers.
  2. Checks if User is in Room.
    1. If User is not in a Room:
      1. ABORT and return error.
    2. Else:
      1. If parameter stopMediaOptions.userMedia value is true:
        1. Invoke stopStream() method. Regardless of request errors, leaveRoom() will still proceed.
      2. If parameter stopMediaOptions.screenshare value is true:
        1. Invoke stopScreen() method. Regardless of request errors, leaveRoom() will still proceed.
      3. peerLeft event triggers for User and all connected Peers in Room.
      4. If MCU is enabled for the App Key provided in init() method and connected:
        1. serverPeerLeft event triggers parameter payload serverPeerType as MCU.

Parameters:

  • stopMediaOptions {Boolean | JSON} Optional
    DEFAULT: true

    The flag if leaveRoom() should stop both shareScreen() Stream and getUserMedia() Stream.

    • When provided as a boolean, this sets both stopMediaOptions.userMedia and stopMediaOptions.screenshare to its boolean value.
  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the peerLeft event triggering isSelf parameter payload value as true for request success.

    • error {Error | String}

      The error result in request. Defined as null when there are no errors in request Object signature is the leaveRoom() error when stopping Room session.

    • success {JSON}

      The success result in request. Defined as null when there are errors in request

      • peerId {String}
        The User's Room session Peer ID.
      • previousRoom {String}
        The Room name.

lockRoom

()
  Defined in: source/room-connection.js:600      Available since 0.5.0

Note that broadcasted events from muteStream() method, stopStream() method, stopScreen() method, sendMessage() method, unlockRoom() method and lockRoom() method may be queued when sent within less than an interval.
Function that locks the current Room when in session to prevent other Peers from joining the Room.

Events Sequence:

  1. Requests to Signaling server to lock Room
    1. roomLock event triggers parameter payload isLocked value as true.

muteStream

( options ,   )
  Defined in: source/stream-media.js:635      Available since 0.5.7

Note that broadcasted events from muteStream() method, stopStream() method, stopScreen() method, sendMessage() method, unlockRoom() method and lockRoom() method may be queued when sent within less than an interval.
Function that mutes both getUserMedia() Stream and shareScreen() Stream audio or video tracks.

Example:

        

// Example 1: Mute both audio and video tracks in all Streams skylinkDemo.muteStream({ audioMuted: true, videoMuted: true });

// Example 2: Mute only audio tracks in all Streams skylinkDemo.muteStream({ audioMuted: true, videoMuted: false });

// Example 3: Mute only video tracks in all Streams skylinkDemo.muteStream({ audioMuted: false, videoMuted: true });

Events Sequence:

  1. If provided parameter options is invalid:
    1. ABORT and return error.
  2. Checks if there is any available Streams:
    1. If there is no available Streams:
      1. ABORT and return error.
    2. If User is in Room:
      1. Checks if there is audio tracks to mute / unmute:
        1. If there is audio tracks to mute / unmute:
          1. If options.audioMuted value is not the same as the current peerInfo.mediaStatus.audioMuted: This can be retrieved with getPeerInfo() method.
            1. For Peer only peerUpdated event triggers with parameter payload isSelf value as false.
            2. For Peer only streamMuted event triggers with parameter payload isSelf value as false.
      2. Checks if there is video tracks to mute / unmute:
        1. If there is video tracks to mute / unmute:
          1. If options.videoMuted value is not the same as the current peerInfo.mediaStatus.videoMuted: This can be retrieved with getPeerInfo() method.
            1. For Peer only peerUpdated event triggers with parameter payload isSelf value as false.
            2. For Peer only streamMuted event triggers with parameter payload isSelf value as false.
    3. If options.audioMuted value is not the same as the current peerInfo.mediaStatus.audioMuted or options.videoMuted value is not the same as the current peerInfo.mediaStatus.videoMuted:
      1. localMediaMuted event triggers.
      2. If User is in Room:
        1. streamMuted event triggers with parameter payload isSelf value as true.
        2. peerUpdated event triggers with parameter payload isSelf value as true.

Parameters:

  • options {JSON}

    The Streams muting options.

    • audioMuted {Boolean} Optional
      DEFAULT: true

      The flag if all Streams audio tracks should be muted or not.

    • videoMuted {Boolean} Optional
      DEFAULT: true

      The flag if all Strea.ms video tracks should be muted or not.


off

( [eventName] ,   [callback] ,   )
  Defined in: source/skylink-events.js:1386      Available since 0.5.5

Function that unsubscribes listeners from an event.

Example:

        

// Example 1: Unsubscribe all "peerJoined" event skylinkDemo.off("peerJoined");

// Example 2: Unsubscribe only one listener from "peerJoined event" var pJListener = function (peerId, peerInfo, isSelf) { console.info("peerJoined event has been triggered with:", peerId, peerInfo, isSelf); };

skylinkDemo.off("peerJoined", pJListener);

Events Sequence:

There is no event sequence for this method.

Parameters:

  • eventName {String} Optional

    The event.

    • When not provided, all listeners to all events will be unsubscribed.
  • callback {Function} Optional

    The listener to unsubscribe.

    • When not provided, all listeners associated to the event will be unsubscribed.

on

( eventName ,   callback ,   )
  Defined in: source/skylink-events.js:1307      Available since 0.1.0

Function that subscribes a listener to an event.

Example:

        

// Example 1: Subscribing to "peerJoined" event skylinkDemo.on("peerJoined", function (peerId, peerInfo, isSelf) { console.info("peerJoined event has been triggered with:", peerId, peerInfo, isSelf); });

Events Sequence:

There is no event sequence for this method.

Parameters:

  • eventName {String}

    The event.

  • callback {Function}

    The listener. This will be invoked when event is triggered.


once

( eventName ,   callback ,   [condition] ,   [fireAlways=false] ,   )
  Defined in: source/skylink-events.js:1331      Available since 0.5.4

Function that subscribes a listener to an event once.

Example:

        

// Example 1: Subscribing to "peerJoined" event that triggers without condition skylinkDemo.once("peerJoined", function (peerId, peerInfo, isSelf) { console.info("peerJoined event has been triggered once with:", peerId, peerInfo, isSelf); });

// Example 2: Subscribing to "incomingStream" event that triggers with condition skylinkDemo.once("incomingStream", function (peerId, stream, isSelf, peerInfo) { console.info("incomingStream event has been triggered with User stream:", stream); }, function (peerId, peerInfo, isSelf) { return isSelf; });

// Example 3: Subscribing to "dataTransferState" event that triggers always only when condition is satisfied skylinkDemo.once("dataTransferState", function (state, transferId, peerId, transferInfo) { console.info("Received data transfer from Peer:", transferInfo.data); }, function (state, transferId, peerId) { if (state === skylinkDemo.DATA_TRANSFER_STATE.UPLOAD_REQUEST) { skylinkDemo.acceptDataTransfer(peerId, transferId); } return state === skylinkDemo.DATA_TRANSFER_STATE.DOWNLOAD_COMPLETED; }, true);

Events Sequence:

There is no event sequence for this method.

Parameters:

  • eventName {String}

    The event.

  • callback {Function}

    The listener. This will be invoked once when event is triggered and conditional function is satisfied.

  • condition {Function} Optional

    The conditional function that will be invoked when event is triggered. Return true when invoked to satisfy condition. When not provided, the conditional function will always return true.

  • fireAlways {Boolean} Optional
    DEFAULT: false

    The flag that indicates if once() should act like on() but only invoke listener only when conditional function is satisfied.


refreshConnection

( [targetPeerId] ,   [iceRestart=false] ,   [options] ,   [callback] ,   )
  Defined in: source/peer-connection.js:1      Available since 0.5.5

Note that Edge browser does not support renegotiation. For MCU enabled Peer connections with options.mcuUseRenegoRestart set to false in the init() method, the restart functionality may differ, you may learn more about how to workaround it in this article here. For restarts with Peers connecting from Android, iOS or C++ SDKs, restarts might not work as written in in this article here. Note that this functionality should be used when Peer connection stream freezes during a connection. For a better user experience for only MCU enabled Peer connections, the functionality is throttled when invoked many times in less than the milliseconds interval configured in the init() method.
Function that refreshes Peer connections to update with the current streaming.

Example:

        

// Example 1: Refreshing a Peer connection function refreshFrozenVideoStream (peerId) { skylinkDemo.refreshConnection(peerId, function (error, success) { if (error) return; console.log("Refreshing connection for '" + peerId + "'"); }); }

// Example 2: Refreshing a list of Peer connections function refreshFrozenVideoStreamGroup (peerIdA, peerIdB) { skylinkDemo.refreshConnection([peerIdA, peerIdB], function (error, success) { if (error) { if (error.transferErrors[peerIdA]) { console.error("Failed refreshing connection for '" + peerIdA + "'"); } else { console.log("Refreshing connection for '" + peerIdA + "'"); } if (error.transferErrors[peerIdB]) { console.error("Failed refreshing connection for '" + peerIdB + "'"); } else { console.log("Refreshing connection for '" + peerIdB + "'"); } } else { console.log("Refreshing connection for '" + peerIdA + "' and '" + peerIdB + "'"); } }); }

// Example 3: Refreshing all Peer connections function refreshFrozenVideoStreamAll () { skylinkDemo.refreshConnection(function (error, success) { if (error) { for (var i = 0; i < error.listOfPeers.length; i++) { if (error.refreshErrors[error.listOfPeers[i]]) { console.error("Failed refreshing connection for '" + error.listOfPeers[i] + "'"); } else { console.info("Refreshing connection for '" + error.listOfPeers[i] + "'"); } } } else { console.log("Refreshing connection for all Peers", success.listOfPeers); } }); }

// Example 4: Refresh Peer connection when ICE connection has failed or disconnected // and do a ICE connection refresh (only for non-MCU case) skylinkDemo.on("iceConnectionState", function (state, peerId) { if (!usesMCUKey && [skylinkDemo.ICE_CONNECTION_STATE.FAILED, skylinkDemo.ICE_CONNECTION_STATE.DISCONNECTED].indexOf(state) > -1) { skylinkDemo.refreshConnection(peerId, true); } });

Events Sequence:

  1. Checks if MCU is enabled for App Key provided in init() method
    1. If MCU is enabled:
      1. If there are connected Peers in the Room:
        1. peerRestart event triggers parameter payload isSelfInitiateRestart value as true for all connected Peer connections.
        2. serverPeerRestart event triggers for connected MCU server Peer connection.
      2. If options.mcuUseRenegoRestart value is false set in the init() method:
        1. Invokes joinRoom() method refreshConnection() will retain the User session information except the Peer ID will be a different assigned ID due to restarting the Room session.
          1. If request has errors
            1. ABORT and return error.
    2. Else:
      1. If there are connected Peers in the Room:
        1. Refresh connections for all targeted Peers.
          1. If Peer connection exists:
            1. peerRestart event triggers parameter payload isSelfInitiateRestart value as true for all targeted Peer connections.
          2. Else:
            1. ABORT and return error.

Parameters:

  • targetPeerId {String | Array} Optional

    Note that this is ignored if MCU is enabled for the App Key provided in init() method. refreshConnection() will "refresh" all Peer connections. See the Event Sequence for more information.
    The target Peer ID to refresh connection with.

    • When provided as an Array, it will refresh all connections with all the Peer IDs provided.
    • When not provided, it will refresh all the currently connected Peers in the Room.
  • iceRestart {Boolean} Optional
    DEFAULT: false

    Note that this flag will not be honoured for MCU enabled Peer connections where options.mcuUseRenegoRestart flag is set to false as it is not necessary since for MCU "restart" case is to invoke joinRoom() method again, or that it is not supported by the MCU.
    The flag if ICE connections should restart when refreshing Peer connections. This is used when ICE connection state is FAILED or DISCONNECTED, which state can be retrieved with the iceConnectionState event.

  • options {JSON} Optional

    Note that for MCU connections, the bandwidth or googleXBandwidth settings will override for all Peers or the current Room connection session settings.
    The custom Peer configuration settings.

    • bandwidth {JSON} Optional

      The configuration to set the maximum streaming bandwidth to send to Peers. Object signature follows joinRoom() method options.bandwidth settings.

    • googleXBandwidth {JSON} Optional

      The configuration to set the experimental google video streaming bandwidth sent to Peers. Object signature follows joinRoom() method options.googleXBandwidth settings.

  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the peerRestart event triggering isSelfInitiateRestart parameter payload value as true for all Peers targeted for request success.

    • error {JSON}

      The error result in request. Defined as null when there are no errors in request

      • listOfPeers {Array}
        The list of Peer IDs targeted.
      • refreshErrors {JSON}
        The list of Peer connection refresh errors.
      • refreshErrors.#peerId {Error | String}
        The Peer connection refresh error associated with the Peer ID defined in #peerId property. If #peerId value is "self", it means that it is the error when there is no Peer connections to refresh with.
      • refreshSettings {JSON}
        The list of Peer connection refresh settings.
      • refreshSettings.#peerId {JSON}
        The Peer connection refresh settings associated with the Peer ID defined in #peerId property.
      • refreshSettings.#peerId.iceRestart {Boolean}
        The flag if ICE restart is enabled for this Peer connection refresh session.
      • refreshSettings.#peerId.customSettings {JSON}
        The Peer connection custom settings. Object signature follows getPeersCustomSettings method returned per #peerId object.
    • success {JSON}

      The success result in request. Defined as null when there are errors in request

      • listOfPeers {Array}
        The list of Peer IDs targeted.
      • refreshSettings {JSON}
        The list of Peer connection refresh settings.
      • refreshSettings.#peerId {JSON}
        The Peer connection refresh settings associated with the Peer ID defined in #peerId property.
      • refreshSettings.#peerId.iceRestart {Boolean}
        The flag if ICE restart is enabled for this Peer connection refresh session.
      • refreshSettings.#peerId.customSettings {JSON}
        The Peer connection custom settings. Object signature follows getPeersCustomSettings method returned per #peerId object.

refreshDatachannel

( [peerId] ,   )
  Defined in: source/data-channel.js:203      Available since 0.6.30

Function that refreshes the main messaging Datachannel.

Example:

        

// Example 1: Retrieve offerer and refresh datachannel: skylink.on("dataChannelState", function (state, peerId, error, channelName, channelType) { if (channelType === skylink.DATA_CHANNEL_TYPE.MESSAGING && state === skylink.DATA_CHANNEL_STATE.CLOSED) { var userWeight = skylink.getPeerInfo().config.priorityWeight; var peerWeight = skylink.getPeerInfo(peerId).config.priorityWeight; // Determine who is offerer because as per SM protocol, higher weight is offerer if (userWeight > peerWeight) { skylink.refreshDatachannel(peerId); } } });

Events Sequence:

There is no event sequence for this method.

Parameters:

  • peerId {String} Optional

    The target Peer ID to retrieve connection stats from.


sendBlobData

( data ,   [timeout=60] ,   [targetPeerId] ,   [sendChunksAsBinary=false] ,   [callback] ,   )
  Defined in: source/data-transfer.js:1      Available since 0.5.5

Function that starts an uploading data transfer from User to Peers.

Example:

        

<body> <input type="radio" name="timeout" onchange="setTransferTimeout(0)"> 1s timeout (Default) <input type="radio" name="timeout" onchange="setTransferTimeout(120)"> 2s timeout <input type="radio" name="timeout" onchange="setTransferTimeout(300)"> 5s timeout <hr> <input type="file" onchange="uploadFile(this.files[0], this.getAttribute('data'))" data="peerId"> <input type="file" onchange="uploadFileGroup(this.files[0], this.getAttribute('data').split(',')))" data="peerIdA,peerIdB"> <input type="file" onchange="uploadFileAll(this.files[0])" data=""> <script> var transferTimeout = 0;

function setTransferTimeout (timeout) { transferTimeout = timeout; }

// Example 1: Upload data to a Peer function uploadFile (file, peerId) { var cb = function (error, success) { if (error) return; console.info("File has been transferred to '" + peerId + "' successfully"); }; if (transferTimeout > 0) { skylinkDemo.sendBlobData(file, peerId, transferTimeout, cb); } else { skylinkDemo.sendBlobData(file, peerId, cb); } }

// Example 2: Upload data to a list of Peers function uploadFileGroup (file, peerIds) { var cb = function (error, success) { var listOfPeers = error ? error.listOfPeers : success.listOfPeers; var listOfPeersErrors = error ? error.transferErrors : {}; for (var i = 0; i < listOfPeers.length; i++) { if (listOfPeersErrors[listOfPeers[i]]) { console.error("Failed file transfer to '" + listOfPeers[i] + "'"); } else { console.info("File has been transferred to '" + listOfPeers[i] + "' successfully"); } } }; if (transferTimeout > 0) { skylinkDemo.sendBlobData(file, peerIds, transferTimeout, cb); } else { skylinkDemo.sendBlobData(file, peerIds, cb); } }

// Example 2: Upload data to a list of Peers function uploadFileAll (file) { var cb = function (error, success) { var listOfPeers = error ? error.listOfPeers : success.listOfPeers; var listOfPeersErrors = error ? error.transferErrors : {}; for (var i = 0; i < listOfPeers.length; i++) { if (listOfPeersErrors[listOfPeers[i]]) { console.error("Failed file transfer to '" + listOfPeers[i] + "'"); } else { console.info("File has been transferred to '" + listOfPeers[i] + "' successfully"); } } }; if (transferTimeout > 0) { skylinkDemo.sendBlobData(file, transferTimeout, cb); } else { skylinkDemo.sendBlobData(file, cb); } } </script> </body>

Events Sequence:

  1. Checks if User is in Room.
    1. If User is not in Room:
      1. dataTransferState event triggers parameter payload state as START_ERROR.
      2. ABORT step and return error.
  2. Checks if there is any available Datachannel connections.
    1. If User is not in Room:
      1. dataTransferState event triggers parameter payload state as START_ERROR.
      2. ABORT step and return error.
  3. Checks if provided data parameter is valid.
    1. If it is invalid:
      1. dataTransferState event triggers parameter payload state as START_ERROR.
      2. ABORT step and return error.
  4. Checks if Peer connection and Datachannel connection are in correct states.
    1. If Peer connection or session does not exists:
      1. dataTransferState event triggers parameter payload state as ERROR.
      2. ABORT step and return error.
    2. If Peer connection is not stable: The stable state can be checked with peerConnectionState event triggering parameter payload state as STABLE for Peer.
      1. dataTransferState event triggers parameter payload state as ERROR.
      2. ABORT step and return error.
    3. If Peer connection messaging Datachannel has not been opened: This can be checked with dataChannelState event triggering parameter payload state as OPEN and channelType as MESSAGING for Peer.
      1. dataTransferState event triggers parameter payload state as ERROR.
      2. ABORT step and return error.
    4. If MCU is enabled for the App Key provided in init()method and connected:
      1. If MCU Peer connection is not stable: The stable state can be checked with peerConnectionState event triggering parameter payload state as STABLE and peerId value as "MCU" for MCU Peer.
        1. dataTransferState event triggers parameter payload state as ERROR.
        2. ABORT step and return error.
      2. If MCU Peer connection messaging Datachannel has not been opened: This can be checked with dataChannelState event triggering parameter payload state as OPEN, peerId value as "MCU" and channelType as MESSAGING for MCU Peer.
        1. dataTransferState event triggers parameter payload state as ERROR.
        2. ABORT step and return error.
    5. Checks if should open a new data Datachannel.
      1. If Peer supports simultaneous data transfer, open new data Datachannel: If MCU is connected, this opens a new data Datachannel with MCU Peer with all the Peers IDs information that supports simultaneous data transfers targeted for the data transfer session instead of opening new data Datachannel with all Peers targeted for the data transfer session.
        1. dataChannelState event triggers parameter payload state as CONNECTING and channelType as DATA. Note that there is no timeout to wait for parameter payload state to be OPEN.
        2. If Datachannel has been created and opened successfully:
          1. dataChannelState event triggers parameter payload state as OPEN and channelType as DATA.
        3. Else:
          1. dataChannelState event triggers parameter payload state as CREATE_ERROR and channelType as DATA.
          2. dataTransferState event triggers parameter payload state as ERROR.
          3. ABORT step and return error.
      2. Else: If MCU is connected, this uses the messaging Datachannel with MCU Peer with all the Peers IDs information that supports simultaneous data transfers targeted for the data transfer session instead of using the messaging Datachannels with all Peers targeted for the data transfer session.
        1. If messaging Datachannel connection has a data transfer in-progress:
          1. dataTransferState event triggers parameter payload state as ERROR.
          2. ABORT step and return error.
        2. If there is any conflicting streamData() method data streaming session: If sendChunksAsBinary is provided as true, it cannot start if existing data streaming session is expected binary data chunks, and if provided as false, or method invoked is sendURLData() method, or Peer is using string data chunks fallback due to its support despite provided as true, it cannot start if existing data streaming session is expected string data chunks.
          1. dataTransferState event triggers parameter payload state as ERROR.
          2. ABORT step and return error.
  5. Starts the data transfer to Peer.
    1. incomingDataRequest event triggers.
    2. For User only dataTransferState event triggers parameter payload state as USER_UPLOAD_REQUEST.
    3. For Peer only dataTransferState event triggers parameter payload state as UPLOAD_REQUEST.
    4. Peer invokes acceptDataTransfer() method.
      1. If parameter accept value is true:
        1. User starts upload data transfer to Peer.
          1. For User only dataTransferState event triggers parameter payload state as UPLOAD_STARTED.
          2. For Peer only dataTransferState event triggers parameter payload state as DOWNLOAD_STARTED.
        2. If Peer / User invokes cancelDataTransfer() method:
          1. dataTransferState event triggers parameter state as CANCEL.
          2. ABORT step and return error.
        3. If data transfer has timeout errors:
          1. dataTransferState event triggers parameter state as ERROR.
          2. ABORT step and return error.
        4. Checks for Peer connection and Datachannel connection during data transfer:
          1. If MCU is enabled for the App Key provided in init() method and connected:
            1. If MCU Datachannel has closed abruptly during data transfer:
                This can be checked with dataChannelState event triggering parameter payload state as CLOSED, peerId value as "MCU" and channelType as DATA for targeted Peers that supports simultaneous data transfer or MESSAGING for targeted Peers that do not support it.
                1. dataTransferState event triggers parameter state as ERROR.
                2. ABORT step and return error.
            2. If MCU Peer connection has changed from not being stable:
                This can be checked with peerConnection event triggering parameter payload state as not STABLE, peerId value as "MCU".
                1. dataTransferState event triggers parameter state as ERROR.
                2. ABORT step and return error.
            3. If Peer connection has changed from not being stable:
                This can be checked with peerConnection event triggering parameter payload state as not STABLE.
                1. dataTransferState event triggers parameter state as ERROR.
                2. ABORT step and return error.
          2. Else:
            1. If Datachannel has closed abruptly during data transfer: This can be checked with dataChannelState event triggering parameter payload state as CLOSED and channelType as DATA for Peer that supports simultaneous data transfer or MESSAGING for Peer that do not support it.
              1. dataTransferState event triggers parameter state as ERROR.
              2. ABORT step and return error.
        5. If data transfer is still progressing:
          1. For User only dataTransferState event triggers parameter payload state as UPLOADING.
          2. For Peer only dataTransferState event triggers parameter payload state as DOWNLOADING.
        6. If data transfer has completed
          1. incomingData event triggers.
          2. For User only dataTransferState event triggers parameter payload state as UPLOAD_COMPLETED.
          3. For Peer only dataTransferState event triggers parameter payload state as DOWNLOAD_COMPLETED.
      2. If parameter accept value is false:
        1. For User only dataTransferState event triggers parameter payload state as REJECTED.
        2. For Peer only dataTransferState event triggers parameter payload state as USER_REJECTED.
        3. ABORT step and return error.

Parameters:

  • data {Blob}

    The Blob object.

  • timeout {Number} Optional
    DEFAULT: 60

    The timeout to wait for response from Peer.

  • targetPeerId {String | Array} Optional

    The target Peer ID to start data transfer with.

    • When provided as an Array, it will start uploading data transfers with all connections with all the Peer IDs provided.
    • When not provided, it will start uploading data transfers with all the currently connected Peers in the Room.
  • sendChunksAsBinary {Boolean} Optional
    DEFAULT: false

    Note that this is currently not supported for MCU enabled Peer connections or Peer connections connecting from Android, iOS and Linux SDKs. This would fallback to transferInfo.chunkType to BINARY_STRING when MCU is connected.
    The flag if data transfer binary data chunks should not be encoded as Base64 string during data transfers.

  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the dataTransferState event triggering state parameter payload as UPLOAD_COMPLETED for all Peers targeted for request success.

    • error {JSON}

      The error result in request. Defined as null when there are no errors in request

      • transferId {String}
        The data transfer ID. Defined as null when sendBlobData() fails to start data transfer.
      • listOfPeers {Array}
        The list Peer IDs targeted for the data transfer.
      • transferErrors {JSON}
        The list of data transfer errors.
      • transferErrors.#peerId {Error | String}
        The data transfer error associated with the Peer ID defined in #peerId property. If #peerId value is "self", it means that it is the error when there are no Peer connections to start data transfer with.
      • transferInfo {JSON}
        The data transfer information. Object signature matches the transferInfo parameter payload received in the dataTransferState event except without the percentage and data property.
    • success {JSON}

      The success result in request. Defined as null when there are errors in request

      • transferId {String}
        The data transfer ID.
      • listOfPeers {Array}
        The list Peer IDs targeted for the data transfer.
      • transferInfo {JSON}
        The data transfer information. Object signature matches the transferInfo parameter payload received in the dataTransferState event except without the percentage property and data.

sendMessage

( message ,   [targetPeerId] ,   )
  Defined in: source/socket-message.js:1      Available since 0.4.0

Note that broadcasted events from muteStream() method, stopStream() method, stopScreen() method, sendMessage() method, unlockRoom() method and lockRoom() method may be queued when sent within less than an interval.
Function that sends a message to Peers via the Signaling socket connection.

Example:

        

// Example 1: Broadcasting to all Peers skylinkDemo.sendMessage("Hi all!");

// Example 2: Sending to specific Peers var peersInExclusiveParty = [];

skylinkDemo.on("peerJoined", function (peerId, peerInfo, isSelf) { if (isSelf) return; if (peerInfo.userData.exclusive) { peersInExclusiveParty.push(peerId); } });

function updateExclusivePartyStatus (message) { skylinkDemo.sendMessage(message, peersInExclusiveParty); }

Events Sequence:

  1. Sends socket connection message to all targeted Peers via Signaling server.
    1. incomingMessage event triggers parameter payload message.isDataChannel value as false.

Parameters:

  • message {String | JSON}

    The message.

  • targetPeerId {String | Array} Optional

    The target Peer ID to send message to.

    • When provided as an Array, it will send the message to only Peers which IDs are in the list.
    • When not provided, it will broadcast the message to all connected Peers in the Room.

sendP2PMessage

( message ,   [targetPeerId] ,   )
  Defined in: source/data-transfer.js:652      Available since 0.5.5

Function that sends a message to Peers via the Datachannel connection. Consider using sendURLData() method if you are sending large strings to Peers.

Example:

        

// Example 1: Broadcasting to all Peers skylinkDemo.on("dataChannelState", function (state, peerId, error, channelName, channelType) { if (state === skylinkDemo.DATA_CHANNEL_STATE.OPEN && channelType === skylinkDemo.DATA_CHANNEL_TYPE.MESSAGING) { skylinkDemo.sendP2PMessage("Hi all!"); } });

// Example 2: Sending to specific Peers var peersInExclusiveParty = [];

skylinkDemo.on("peerJoined", function (peerId, peerInfo, isSelf) { if (isSelf) return; if (peerInfo.userData.exclusive) { peersInExclusiveParty[peerId] = false; } });

skylinkDemo.on("dataChannelState", function (state, peerId, error, channelName, channelType) { if (state === skylinkDemo.DATA_CHANNEL_STATE.OPEN && channelType === skylinkDemo.DATA_CHANNEL_TYPE.MESSAGING) { peersInExclusiveParty[peerId] = true; } });

function updateExclusivePartyStatus (message) { var readyToSend = []; for (var p in peersInExclusiveParty) { if (peersInExclusiveParty.hasOwnProperty(p)) { readyToSend.push(p); } } skylinkDemo.sendP2PMessage(message, readyToSend); }

Events Sequence:

  1. Sends P2P message to all targeted Peers.
    1. If Peer connection Datachannel has not been opened: This can be checked with dataChannelState event triggering parameter payload state as OPEN and channelType as MESSAGING for Peer.
      1. dataChannelState event triggers parameter payload state as SEND_MESSAGE_ERROR.
      2. ABORT step and return error.
    2. incomingMessage event triggers parameter payload message.isDataChannel value as true and isSelf value as true.

Parameters:

  • message {String | JSON}

    The message.

  • targetPeerId {String | Array} Optional

    The target Peer ID to send message to.

    • When provided as an Array, it will send the message to only Peers which IDs are in the list.
    • When not provided, it will broadcast the message to all connected Peers with Datachannel connection in the Room.

sendStream

( options ,   [callback] ,   )
  Defined in: source/stream-media.js:390      Available since 0.5.6

Note that if shareScreen() Stream is available despite having getUserMedia() Stream available, the shareScreen() Stream is sent instead of the getUserMedia() Stream to Peers.
Function that sends a new getUserMedia() Stream to all connected Peers in the Room.

Example:

        

// Example 1: Send MediaStream object before being connected to Room function retrieveStreamBySourceForFirefox (sourceId) { navigator.mediaDevices.getUserMedia({ audio: true, video: { sourceId: { exact: sourceId } } }).then(function (stream) { skylinkDemo.sendStream(stream, function (error, success) { if (err) return; if (stream === success) { console.info("Same MediaStream has been sent"); } console.log("Stream is now being sent to Peers"); attachMediaStream(document.getElementById("my-video"), success); }); }); }

// Example 2: Send video after being connected to Room function sendVideo () { skylinkDemo.joinRoom(function (jRError, jRSuccess) { if (jRError) return; skylinkDemo.sendStream({ audio: true, video: true }, function (error, success) { if (error) return; console.log("getUserMedia() Stream with video is now being sent to Peers"); attachMediaStream(document.getElementById("my-video"), success); }); }); }

Events Sequence:

  1. Checks options provided.
    1. If provided parameter options is not valid:
      1. ABORT and return error.
    2. Else if provided parameter options is a Stream object:
      1. Checks if there is any audio or video tracks.
        1. If there is no tracks:
          1. ABORT and return error.
        2. Else:
          1. Set options.audio value as true if Stream has audio tracks.
          2. Set options.video value as false if Stream has video tracks.
          3. Mutes / Unmutes audio and video tracks based on current muted settings in peerInfo.mediaStatus. This can be retrieved with getPeerInfo() method.
          4. If there is any previous getUserMedia() Stream:
            1. Invokes stopStream() method to stop previous Stream.
          5. mediaAccessSuccess event triggers parameter payload isScreensharing value as false and isAudioFallback value as false.
    3. Else:
      1. Invoke getUserMedia() method with options provided in sendStream().
        1. If request has errors:
          1. ABORT and return error.
  2. If there is currently no shareScreen() Stream and User is in Room:
    1. incomingStream event triggers parameter payload isSelf value as true and stream as getUserMedia() Stream.
    2. peerUpdated event triggers parameter payload isSelf value as true.
    3. Checks if MCU is enabled for App Key provided in init() method.
      1. If MCU is enabled:
        1. Invoke refreshConnection() method.
          1. If request has errors:
            1. ABORT and return error.
      2. Else:
        1. If there are connected Peers in the Room:
          1. Invoke refreshConnection() method.
            1. If request has errors:
              1. ABORT and return error.

Parameters:

  • options {JSON | MediaStream}

    The getUserMedia() method options parameter settings.

    • When provided as a MediaStream object, this configures the options.audio and options.video based on the tracks available in the MediaStream object, and configures the options.audio.mute and options.video.mute based on the tracks .enabled flags in the tracks provided in the MediaStream object without invoking getUserMedia() method. Object signature matches the options parameter in the getUserMedia() method.
  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the mediaAccessSuccess event triggering isScreensharing parameter payload value as false for request success when User is in Room without Peers, or by the peerRestart event triggering isSelfInitiateRestart parameter payload value as true for all connected Peers for request success when User is in Room with Peers.

    • error {Error | String}

      The error result in request. Defined as null when there are no errors in request Object signature is the getUserMedia() method error or when invalid options is provided.

    • success {MediaStream}

      The success result in request. Defined as null when there are errors in request Object signature is the getUserMedia() method Stream object.


sendURLData

( data ,   [timeout=60] ,   [targetPeerId] ,   [callback] ,   )
  Defined in: source/data-transfer.js:253      Available since 0.6.1

Function that starts an uploading string data transfer from User to Peers.

Example:

        

<body> <input type="radio" name="timeout" onchange="setTransferTimeout(0)"> 1s timeout (Default) <input type="radio" name="timeout" onchange="setTransferTimeout(120)"> 2s timeout <input type="radio" name="timeout" onchange="setTransferTimeout(300)"> 5s timeout <hr> <input type="file" onchange="showImage(this.files[0], this.getAttribute('data'))" data="peerId"> <input type="file" onchange="showImageGroup(this.files[0], this.getAttribute('data').split(',')))" data="peerIdA,peerIdB"> <input type="file" onchange="showImageAll(this.files[0])" data=""> <image id="target-1" src=""> <image id="target-2" src=""> <image id="target-3" src=""> <script> var transferTimeout = 0;

function setTransferTimeout (timeout) { transferTimeout = timeout; }

function retrieveImageDataURL(file, cb) { var fr = new FileReader(); fr.onload = function () { cb(fr.result); }; fr.readAsDataURL(files[0]); }

// Example 1: Send image data URL to a Peer function showImage (file, peerId) { var cb = function (error, success) { if (error) return; console.info("Image has been transferred to '" + peerId + "' successfully"); }; retrieveImageDataURL(file, function (str) { if (transferTimeout > 0) { skylinkDemo.sendURLData(str, peerId, transferTimeout, cb); } else { skylinkDemo.sendURLData(str, peerId, cb); } document.getElementById("target-1").src = str; }); }

// Example 2: Send image data URL to a list of Peers function showImageGroup (file, peerIds) { var cb = function (error, success) { var listOfPeers = error ? error.listOfPeers : success.listOfPeers; var listOfPeersErrors = error ? error.transferErrors : {}; for (var i = 0; i < listOfPeers.length; i++) { if (listOfPeersErrors[listOfPeers[i]]) { console.error("Failed image transfer to '" + listOfPeers[i] + "'"); } else { console.info("Image has been transferred to '" + listOfPeers[i] + "' successfully"); } } }; retrieveImageDataURL(file, function (str) { if (transferTimeout > 0) { skylinkDemo.sendURLData(str, peerIds, transferTimeout, cb); } else { skylinkDemo.sendURLData(str, peerIds, cb); } document.getElementById("target-2").src = str; }); }

// Example 2: Send image data URL to a list of Peers function uploadFileAll (file) { var cb = function (error, success) { var listOfPeers = error ? error.listOfPeers : success.listOfPeers; var listOfPeersErrors = error ? error.transferErrors : {}; for (var i = 0; i < listOfPeers.length; i++) { if (listOfPeersErrors[listOfPeers[i]]) { console.error("Failed image transfer to '" + listOfPeers[i] + "'"); } else { console.info("Image has been transferred to '" + listOfPeers[i] + "' successfully"); } } }; retrieveImageDataURL(file, function (str) { if (transferTimeout > 0) { skylinkDemo.sendURLData(str, transferTimeout, cb); } else { skylinkDemo.sendURLData(str, cb); } document.getElementById("target-3").src = str; }); } </script> </body>

Events Sequence:

Event sequence follows sendBlobData() method.

Parameters:

  • data {String}

    The data string to transfer to Peer.

  • timeout {Number} Optional
    DEFAULT: 60

    The timeout to wait for response from Peer.

  • targetPeerId {String | Array} Optional

    The target Peer ID to start data transfer with.

    • When provided as an Array, it will start uploading data transfers with all connections with all the Peer IDs provided.
    • When not provided, it will start uploading data transfers with all the currently connected Peers in the Room.
  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the dataTransferState event triggering state parameter payload as UPLOAD_COMPLETED for all Peers targeted for request success.

    • error {JSON}

      The error result in request. Defined as null when there are no errors in request

      • transferId {String}
        The data transfer ID. Defined as null when sendURLData() fails to start data transfer.
      • listOfPeers {Array}
        The list Peer IDs targeted for the data transfer.
      • transferErrors {JSON}
        The list of data transfer errors.
      • transferErrors.#peerId {Error | String}
        The data transfer error associated with the Peer ID defined in #peerId property. If #peerId value is "self", it means that it is the error when there are no Peer connections to start data transfer with.
      • transferInfo {JSON}
        The data transfer information. Object signature matches the transferInfo parameter payload received in the dataTransferState event except without the percentage property and data.
    • success {JSON}

      The success result in request. Defined as null when there are errors in request

      • transferId {String}
        The data transfer ID.
      • listOfPeers {Array}
        The list Peer IDs targeted for the data transfer.
      • transferInfo {JSON}
        The data transfer information. Object signature matches the transferInfo parameter payload received in the dataTransferState event except without the percentage property and data.

setDebugMode

( [options=false] ,   )
  Defined in: source/skylink-debug.js:423      Available since 0.5.2

Function that configures the debugging mode of the SDK.

Example:

        

// Example 1: Enable both options.storeLogs and options.trace skylinkDemo.setDebugMode(true);

// Example 2: Enable only options.storeLogs skylinkDemo.setDebugMode({ storeLogs: true });

// Example 3: Disable debugging mode skylinkDemo.setDebugMode();

Events Sequence:

There is no event sequence for this method.

Parameters:

  • options {Boolean | JSON} Optional
    DEFAULT: false

    The debugging options.

    • When provided as a boolean, this sets both options.trace and options.storeLogs to its boolean value.
    • trace {Boolean} Optional
      DEFAULT: false

      The flag if SDK console logs should output as console.trace() logs for tracing the Function call stack. Note that the console.trace() output logs is determined by the log level set setLogLevel() method. If console.trace() API is not supported, setDebugMode() will fallback to use console.log() API.

    • storeLogs {Boolean} Optional
      DEFAULT: false

      The flag if SDK should store the console logs. This is required to be enabled for SkylinkLogs API.

    • printTimestamp {Boolean} Optional
      DEFAULT: false

      The flag if SDK should print the timestamp of the console logs.


setLogLevel

( [logLevel] ,   )
  Defined in: source/skylink-debug.js:386      Available since 0.5.5

Function that configures the level of console API logs to be printed in the Javascript Web Console.

Example:

        

// Example 1: Print all of the console.debug, console.log, console.info, console.warn and console.error logs. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.DEBUG);

// Example 2: Print only the console.log, console.info, console.warn and console.error logs. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.LOG);

// Example 3: Print only the console.info, console.warn and console.error logs. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.INFO);

// Example 4: Print only the console.warn and console.error logs. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.WARN);

// Example 5: Print only the console.error logs. This is done by default. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.ERROR);

Events Sequence:

There is no event sequence for this method.

Parameters:

  • logLevel {Number} Optional

    The specific log level of logs to return.

    • When not provided or that the level does not exists, it will not overwrite the current log level. By default, the initial log level is ERROR. [Rel: Skylink.LOG_LEVEL]

setUserData

( userData ,   )
  Defined in: source/peer-data.js:1      Available since 0.5.5

Function that overwrites the User current custom data.

Example:

        

// Example 1: Set/Update User custom data before joinRoom() var userData = "beforejoin";

skylinkDemo.setUserData(userData);

skylinkDemo.joinRoom(function (error, success) { if (error) return; if (success.peerInfo.userData === userData) { console.log("User data is sent"); } });

// Example 2: Update User custom data after joinRoom() var userData = "afterjoin";

skylinkDemo.joinRoom(function (error, success) { if (error) return; skylinkDemo.setUserData(userData); if (skylinkDemo.getPeerInfo().userData === userData) { console.log("User data is updated and sent"); } });

Events Sequence:

  1. Updates User custom data.
    1. If User is in Room:
      1. peerUpdated event triggers with parameter payload isSelf value as true.

Parameters:

  • userData {JSON | String}

    The updated custom data.


shareScreen

( [enableAudio=false] ,   [mediaSource=screen] ,   [callback] ,   )
  Defined in: source/stream-media.js:881      Available since 0.6.0

For a better user experience, the functionality is throttled when invoked many times in less than the milliseconds interval configured in the init() method. Note that the Opera and Edge browser does not support screensharing, and as for IE / Safari browsers using the Temasys Plugin screensharing support, check out the commercial licensing for more options.
Function that retrieves screensharing Stream.

Example:

        

// Example 1: Share screen with audio skylinkDemo.shareScreen(true, function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-screen"), success); });

// Example 2: Share screen without audio skylinkDemo.shareScreen(false, function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-screen"), success); });

// Example 3: Share "window" media source skylinkDemo.shareScreen("window", function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-screen"), success); });

// Example 4: Share tab and its audio media source skylinkDemo.shareScreen(true, ["tab", "audio"], function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-screen"), success); });

// Example 5: Share "window" and "screen" media source skylinkDemo.shareScreen(["window", "screen"], function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-screen"), success); });

// Example 6: Share "window" with specific media source for specific plugin build users. skylinkDemo.shareScreen({ mediaSource: "window", sourceId: "xxxxx" }, function (error, success) { if (error) return; attachMediaStream(document.getElementById("my-screen"), success); });

Events Sequence:

  1. Retrieves screensharing Stream.
    1. If retrieval was successful:
      1. If browser is Firefox:
        1. If there are missing audio or video tracks requested:
          1. If there is any previous shareScreen() Stream:
            1. Invokes stopScreen() method.
          2. mediaAccessFallback event triggers parameter payload state as FALLBACKED, isScreensharing value as true and isAudioFallback value as false.
        2. mediaAccessSuccess event triggers parameter payload isScreensharing value as true and isAudioFallback value as false.
      2. Else:
        1. If audio is requested: Chrome, Safari and IE currently doesn't support retrieval of audio track together with screensharing video track.
          1. Retrieves audio Stream:
            1. If retrieval was successful:
              1. Attempts to attach screensharing Stream video track to audio Stream.
                1. If attachment was successful:
                  1. mediaAccessSuccess event triggers parameter payload isScreensharing value as true and isAudioFallback value as false.
                2. Else:
                  1. If there is any previous shareScreen() Stream:
                    1. Invokes stopScreen() method.
                  2. mediaAccessFallback event triggers parameter payload state as FALLBACKED, isScreensharing value as true and isAudioFallback value as false.
                  3. mediaAccessSuccess event triggers parameter payload isScreensharing value as true and isAudioFallback value as false.
            2. Else:
              1. If there is any previous shareScreen() Stream:
                1. Invokes stopScreen() method.
              2. mediaAccessFallback event triggers parameter payload state as FALLBACKED, isScreensharing value as true and isAudioFallback value as false.
              3. mediaAccessSuccess event triggers parameter payload isScreensharing value as true and isAudioFallback value as false.
        2. Else:
          1. mediaAccessSuccess event triggers parameter payload isScreensharing value as true and isAudioFallback value as false.
    2. Else:
      1. mediaAccessError event triggers parameter payload isScreensharing value as true and isAudioFallback value as false.
      2. ABORT and return error.
  2. If User is in Room:
    1. incomingStream event triggers parameter payload isSelf value as true and stream as shareScreen() Stream.
    2. peerUpdated event triggers parameter payload isSelf value as true.
    3. Checks if MCU is enabled for App Key provided in init() method.
      1. If MCU is enabled:
        1. Invoke refreshConnection() method.
          1. If request has errors:
            1. ABORT and return error.
      2. Else:
        1. If there are connected Peers in the Room:
          1. Invoke refreshConnection() method.
            1. If request has errors:
              1. ABORT and return error.

Parameters:

  • enableAudio {JSON | Boolean} Optional
    DEFAULT: false

    The flag if audio tracks should be retrieved.

    • stereo {Boolean} Optional
      DEFAULT: false

      Deprecation Warning! This property has been deprecated. Configure this with the options.codecParams.audio.opus.stereo and the options.codecParams.audio.opus["sprop-stereo"] parameter in the init() method instead. If the options.codecParams.audio.opus.stereo or options.codecParams.audio.opus["sprop-stereo"] is configured, this overrides the options.audio.stereo setting.
      The flag if OPUS audio codec stereo band should be configured for sending encoded audio data. When not provided, the default browser configuration is used.

    • usedtx {Boolean} Optional

      Deprecation Warning! This property has been deprecated. Configure this with the options.codecParams.audio.opus.stereo parameter in the init() method instead. If the options.codecParams.audio.opus.stereo is configured, this overrides the options.audio.stereo setting. Note that this feature might not work depending on the browser support and implementation.
      The flag if OPUS audio codec should enable DTX (Discontinuous Transmission) for sending encoded audio data. This might help to reduce bandwidth as it reduces the bitrate during silence or background noise, and goes hand-in-hand with the options.voiceActivityDetection flag in joinRoom() method. When not provided, the default browser configuration is used.

    • useinbandfec {Boolean} Optional

      Deprecation Warning! This property has been deprecated. Configure this with the options.codecParams.audio.opus.useinbandfec parameter in the init() method instead. If the options.codecParams.audio.opus.useinbandfec is configured, this overrides the options.audio.useinbandfec setting. Note that this parameter should only be used for debugging purposes only.
      The flag if OPUS audio codec has the capability to take advantage of the in-band FEC (Forward Error Correction) when sending encoded audio data. This helps to reduce the harm of packet loss by encoding information about the previous packet loss. When not provided, the default browser configuration is used.

    • maxplaybackrate {Number} Optional

      Deprecation Warning! This property has been deprecated. Configure this with the options.codecParams.audio.opus.maxplaybackrate parameter in the init() method instead. If the options.codecParams.audio.opus.maxplaybackrate is configured, this overrides the options.audio.maxplaybackrate setting. Note that this feature might not work depending on the browser support and implementation. Note that this parameter should only be used for debugging purposes only.
      The OPUS audio codec maximum output sampling rate in Hz (hertz) that is is capable of receiving decoded audio data, to adjust to the hardware limitations and ensure that any sending audio data would not encode at a higher sampling rate specified by this. This value must be between 8000 to 48000. When not provided, the default browser configuration is used.

    • echoCancellation {Boolean} Optional
      DEFAULT: true

      For Chrome/Opera/IE/Safari/Bowser, the echo cancellation functionality may not work and may produce a terrible feedback. It is recommended to use headphones or other microphone devices rather than the device in-built microphones.
      The flag to enable echo cancellation for audio track. Note that this will not be toggled for Chrome/Opera case when mediaSource value is ["tab","audio"].

  • mediaSource {String | Array | JSON} Optional
    DEFAULT: screen

    The screensharing media source to select. Note that multiple sources are not supported by Firefox as of the time of this release. Firefox will use the first item specified in the Array in the event that multiple sources are defined. E.g. ["screen", "window"], ["tab", "audio"], "screen" or "tab" or { sourceId: "xxxxx", mediaSource: "screen" }. [Rel: Skylink.MEDIA_SOURCE]

  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the mediaAccessSuccess event triggering isScreensharing parameter payload value as true for request success when User is not in the Room or is in Room without Peers, or by the peerRestart event triggering isSelfInitiateRestart parameter payload value as true for all connected Peers for request success when User is in Room with Peers.

    • error {Error | String}

      The error result in request. Defined as null when there are no errors in request Object signature is the shareScreen() error when retrieving screensharing Stream.

    • success {MediaStream}

      The success result in request. Defined as null when there are errors in request Object signature is the screensharing Stream object.


startRecording

( [callback] ,   )
  Defined in: source/socket-message.js:111      Available since 0.6.16

Note that this feature requires MCU and recording to be enabled for the App Key provided in the init() method. If recording feature is not available to be enabled in the Developer Console, please contact us on our support portal.
Starts a recording session.

Example:

        

// Example 1: Start recording session skylinkDemo.startRecording(function (error, success) { if (error) return; console.info("Recording session has started. ID ->", success); });

Events Sequence:

  1. If MCU is not connected:
    1. ABORT and return error.
  2. If there is an existing recording session currently going on:
    1. ABORT and return error.
  3. Sends to MCU via Signaling server to start recording session.
    1. If recording session has been started successfully:
      1. recordingState event triggers parameter payload state as START.

Parameters:

  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the recordingState event triggering state parameter payload as START.

    • error {Error | String}

      The error result in request. Defined as null when there are no errors in request Object signature is the startRecording() error when starting a new recording session.

    • success {String | JSON}

      The success result in request. Defined as null when there are errors in request Object signature is the recordingState event triggered recordingId parameter payload.


startStreamingData

( [isStringStream=false] ,   [targetPeerId] ,   )
beta
  Defined in: source/data-transfer.js:787      Available since 0.6.18

Note that this feature is not supported by MCU enabled Peer connections and the enableSimultaneousTransfers flag has to be enabled in the init() method in order for this functionality to work.
To start streaming data, see the streamData() method. To stop data streaming session, see the stopStreamingData() method.
Function that starts a data chunks streaming session from User to Peers.

Example:

        

// Example 1: Start streaming to all Peers skylinkDemo.on("dataChannelState", function (state, peerId, error, channelName, channelType) { if (state === skylinkDemo.DATA_CHANNEL_STATE.OPEN && channelType === skylinkDemo.DATA_CHANNEL_TYPE.MESSAGING) { skylinkDemo.startStreamingData(false); } });

// Example 2: Start streaming to specific Peers var peersInExclusiveParty = [];

skylinkDemo.on("peerJoined", function (peerId, peerInfo, isSelf) { if (isSelf) return; if (peerInfo.userData.exclusive) { peersInExclusiveParty[peerId] = false; } });

skylinkDemo.on("dataChannelState", function (state, peerId, error, channelName, channelType) { if (state === skylinkDemo.DATA_CHANNEL_STATE.OPEN && channelType === skylinkDemo.DATA_CHANNEL_TYPE.MESSAGING) { peersInExclusiveParty[peerId] = true; } });

function updateExclusivePartyStatus (message) { var readyToSend = []; for (var p in peersInExclusiveParty) { if (peersInExclusiveParty.hasOwnProperty(p)) { readyToSend.push(p); } } skylinkDemo.startStreamingData(message, readyToSend); }

Events Sequence:

  1. Checks if User is in Room.
    1. If User is not in Room:
      1. dataStreamState event triggers parameter payload state as START_ERROR.
      2. ABORT step and return error.
  2. Checks if there is any available Datachannel connections.
    1. If User is not in Room:
      1. dataStreamState event triggers parameter payload state as START_ERROR.
      2. ABORT step and return error.
  3. Checks if Peer connection and Datachannel connection are in correct states.
    1. If Peer connection or session does not exists:
      1. dataStreamState event triggers parameter payload state as START_ERROR.
      2. ABORT step and return error.
    2. If Peer connection messaging Datachannel has not been opened: This can be checked with dataChannelState event triggering parameter payload state as OPEN and channelType as MESSAGING for Peer.
      1. dataStreamState event triggers parameter payload state as START_ERROR.
      2. ABORT step and return error.
    3. If MCU is enabled for the App Key provided in init()method and connected:
      1. If MCU Peer connection messaging Datachannel has not been opened: This can be checked with dataChannelState event triggering parameter payload state as OPEN, peerId value as "MCU" and channelType as MESSAGING for MCU Peer.
        1. dataStreamState event triggers parameter payload state as START_ERROR.
        2. ABORT step and return error.
    4. Checks if should open a new data Datachannel.
      1. If Peer supports simultaneous data streaming, open new data Datachannel: If MCU is connected, this opens a new data Datachannel with MCU Peer with all the Peers IDs information that supports simultaneous data transfers targeted for the data streaming session instead of opening new data Datachannel with all Peers targeted for the data streaming session.
        1. dataChannelState event triggers parameter payload state as CONNECTING and channelType as DATA. Note that there is no timeout to wait for parameter payload state to be OPEN.
        2. If Datachannel has been created and opened successfully:
          1. dataChannelState event triggers parameter payload state as OPEN and channelType as DATA.
        3. Else:
          1. dataChannelState event triggers parameter payload state as CREATE_ERROR and channelType as DATA.
          2. dataStreamState event triggers parameter payload state as START_ERROR.
          3. ABORT step and return error.
      2. Else: If MCU is connected, this uses the messaging Datachannel with MCU Peer with all the Peers IDs information that supports simultaneous data transfers targeted for the data streaming session instead of using the messaging Datachannels with all Peers targeted for the data streaming session.
        1. If messaging Datachannel connection has a data streaming in-progress:
          1. dataStreamState event triggers parameter payload state as START_ERROR.
          2. ABORT step and return error.
        2. If there is any conflicting streamData() method data streaming session: If isStringStream is provided as true and sendBlobData() method or sendURLData() method has an existing binary string transfer, it cannot start string data streaming session. Else if sendBlobData() method has an existing binary data transfer, it cannot start binary data streaming session.
          1. dataStreamState event triggers parameter payload state as START_ERROR.
          2. ABORT step and return error.
  4. Starts the data streaming session with Peer.
    1. incomingDataStreamStarted event triggers.
    2. For User only dataStreamState event triggers parameter payload state as SENDING_STARTED.
    3. For Peer only dataStreamState event triggers parameter payload state as RECEIVING_STARTED.

Parameters:

  • isStringStream {Boolean} Optional
    DEFAULT: false

    The flag if data streaming session sending data chunks should be expected as string data chunks sent. By default, data chunks are expected to be sent in Blob or ArrayBuffer, and ArrayBuffer data chunks will be converted to Blob.

  • targetPeerId {String | Array} Optional

    The target Peer ID to send message to.

    • When provided as an Array, it will start streaming session to only Peers which IDs are in the list.
    • When not provided, it will start the streaming session to all connected Peers with Datachannel connection in the Room.

stopRecording

( [callback] ,   [callbackSuccessWhenLink=false] ,   )
  Defined in: source/socket-message.js:191      Available since 0.6.16

Note that this feature requires MCU and recording to be enabled for the App Key provided in the init() method. If recording feature is not available to be enabled in the Developer Console, please contact us on our support portal.
Stops a recording session.

Example:

        

// Example 1: Stop recording session skylinkDemo.stopRecording(function (error, success) { if (error) return; console.info("Recording session has stopped. ID ->", success); });

// Example 2: Stop recording session with mixin videos link skylinkDemo.stopRecording(function (error, success) { if (error) return; console.info("Recording session has compiled with links ->", success.link); }, true);

Events Sequence:

  1. If MCU is not connected:
    1. ABORT and return error.
  2. If there is no existing recording session currently going on:
    1. ABORT and return error.
  3. If existing recording session recording time has not elapsed more than 4 seconds: 4 seconds is mandatory for recording session to ensure better recording experience and stability.
    1. ABORT and return error.
  4. Sends to MCU via Signaling server to stop recording session:
    1. If recording session has been stopped successfully:
      1. recordingState event triggers parameter payload state as START.
      2. MCU starts mixin recorded session videos:
        1. If recording session has been mixin successfully with links:
          1. recordingState event triggers parameter payload state as LINK.
          2. Else:
            1. recordingState event triggers parameter payload state as ERROR.
            2. ABORT and return error.
      3. Else:
        1. recordingState event triggers parameter payload state as ERROR.
        2. ABORT and return error.

Parameters:

  • callback {Function} Optional

    The callback function fired when request has completed. Function parameters signature is function (error, success) Function request completion is determined by the recordingState event triggering state parameter payload as STOP or as LINK when the value of callbackSuccessWhenLink is true.

    • error {Error | String}

      The error result in request. Defined as null when there are no errors in request Object signature is the stopRecording() error when stopping current recording session.

    • success {String | JSON}

      The success result in request.

      • When callbackSuccessWhenLink value is false, it is defined as string as the recording session ID.
      • when callbackSuccessWhenLink value is true, it is defined as an object as the recording session information. Defined as null when there are errors in request
      • recordingId {JSON}
        The recording session ID.
      • link {JSON}
        The recording session mixin videos link in MP4 format. Object signature matches the link parameter payload received in the recordingState event.
  • callbackSuccessWhenLink {Boolean} Optional
    DEFAULT: false

    The flag if callback function provided should result in success only when recordingState event triggering state parameter payload as LINK.


stopScreen

()
  Defined in: source/stream-media.js:1368      Available since 0.6.0

Note that broadcasted events from muteStream() method, stopStream() method, stopScreen() method, sendMessage() method, unlockRoom() method and lockRoom() method may be queued when sent within less than an interval.
Function that stops shareScreen() Stream.

Example:

        

function stopScreen () { skylinkDemo.stopScreen(); }

skylinkDemo.shareScreen();

Events Sequence:

  1. Checks if there is shareScreen() Stream.
    1. If there is shareScreen() Stream:
      1. Stop shareScreen() Stream Stream.
        1. mediaAccessStopped event triggers parameter payload isScreensharing value as true and isAudioFallback value as false.
        2. If User is in Room:
          1. streamEnded event triggers parameter payload isSelf value as true and isScreensharing value as true.
          2. peerUpdated event triggers parameter payload isSelf value as true.
      2. If User is in Room: SKIP this step if stopScreen() was invoked from shareScreen() method.
        1. If there is getUserMedia()Stream Stream:
          1. incomingStream event triggers parameter payload isSelf value as true and stream as getUserMedia() Stream.
          2. peerUpdated event triggers parameter payload isSelf value as true.
        2. Invoke refreshConnection() method.

stopStream

()
  Defined in: source/stream-media.js:596      Available since 0.5.6

Note that broadcasted events from muteStream() method, stopStream() method, stopScreen() method, sendMessage() method, unlockRoom() method and lockRoom() method may be queued when sent within less than an interval.
Function that stops getUserMedia() Stream.

Example:

        

function stopStream () { skylinkDemo.stopStream(); }

skylinkDemo.getUserMedia();

Events Sequence:

  1. Checks if there is getUserMedia() Stream.
    1. If there is getUserMedia() Stream:
      1. Stop getUserMedia() Stream Stream.
        1. mediaAccessStopped event triggers parameter payload isScreensharing value as false.
        2. If User is in Room:
          1. streamEnded event triggers parameter payload isSelf value as true and isScreensharing value asfalse .
          2. peerUpdated event triggers parameter payload isSelf value as true.

stopStreamingData

( streamId ,   )
beta
  Defined in: source/data-transfer.js:1387      Available since 0.6.18

To start data streaming session, see the startStreamingData() method To start streaming data, see the streamData() method.
Function that stops a data chunks streaming session from User to Peers.

Example:

        

skylinkDemo.stopStreamData(streamId);

Events Sequence:

  1. Checks if Peer connection and Datachannel connection are in correct states.
    1. If Peer connection (or MCU Peer connection if enabled) data streaming Datachannel has not been opened: This can be checked with dataChannelState event triggering parameter payload state as OPEN and channelType as MESSAGING for Peer.
      1. dataStreamState event triggers parameter payload state as ERROR.
      2. ABORT step and return error.
  2. Stops the data streaming session to Peer.
    1. incomingDataStreamStopped event triggers.
    2. For User only dataStreamState event triggers parameter payload state as SENDING_STOPPED.
    3. For Peer only dataStreamState event triggers parameter payload state as RECEIVING_STOPPED.

Parameters:

  • streamId {String}

    The data streaming session ID.


streamData

( streamId ,   chunk ,   )
beta
  Defined in: source/data-transfer.js:1191      Available since 0.6.18

Note that this feature is not supported by MCU enabled Peer connections.
To start data streaming session, see the startStreamingData() method. To stop data streaming session, see the stopStreamingData() method
Function that sends a data chunk from User to Peers for an existing active data streaming session.

Example:

        

// Example 1: Start streaming var currentStreamId = null if (file.size > chunkLimit) { while ((file.size - 1) > endCount) { endCount = startCount + chunkLimit; chunks.push(file.slice(startCount, endCount)); startCount += chunkLimit; } if ((file.size - (startCount + 1)) > 0) { chunks.push(file.slice(startCount, file.size - 1)); } } else { chunks.push(file); } var processNextFn = function () { if (chunks.length > 0) { skylinkDemo.once("incomingDataStream", function () { setTimeout(processNextFn, 1); }, function (data, evtStreamId, evtPeerId, streamInfo, isSelf) { return isSelf && evtStreamId === currentStreamId; }); var chunk = chunks[0]; chunks.splice(0, 1); skylinkDemo.streamData(currentStreamId, chunk); } else { skylinkDemo.stopStreamingData(currentStreamId); } }; skylinkDemo.once("incomingDataStreamStarted", processNextFn, function (streamId, peerId, streamInfo, isSelf) { currentStreamId = streamId; return isSelf; }); skylinkDemo.once("incomingDataStreamStopped", function () { // Render file }, function (streamId, peerId, streamInfo, isSelf) { return currentStreamId === streamId && isSelf; }); skylinkDemo.startStreamingData(false);

Events Sequence:

  1. Checks if Peer connection and Datachannel connection are in correct states.
    1. If Peer connection (or MCU Peer connection if enabled) data streaming Datachannel has not been opened: This can be checked with dataChannelState event triggering parameter payload state as OPEN and channelType as MESSAGING for Peer.
      1. dataStreamState event triggers parameter payload state as ERROR.
      2. ABORT step and return error.
  2. Starts sending the data chunk to Peer.
    1. incomingDataStream event triggers.
    2. For User only dataStreamState event triggers parameter payload state as SENT.
    3. For Peer only dataStreamState event triggers parameter payload state as RECEIVED.

Parameters:

  • streamId {String}

    The data streaming session ID.

  • chunk {String | Blob | ArrayBuffer}

    The data chunk. By default when it is not string data streaming, data chunks when is are expected to be sent in Blob or ArrayBuffer, and ArrayBuffer data chunks will be converted to Blob. For binary data chunks, the limit is 65456. For string data chunks, the limit is 1212.


unlockRoom

()
  Defined in: source/room-connection.js:634      Available since 0.5.0

Note that broadcasted events from muteStream() method, stopStream() method, stopScreen() method, sendMessage() method, unlockRoom() method and lockRoom() method may be queued when sent within less than an interval.
Function that unlocks the current Room when in session to allow other Peers to join the Room.

Events Sequence:

  1. Requests to Signaling server to unlock Room
    1. roomLock event triggers parameter payload isLocked value as false.

SkylinkLogs

()
global
  Defined in: source/skylink-debug.js:177      Available since 0.5.5

To utilise and enable the SkylinkLogs API functionalities, the setDebugMode() method options.storeLogs parameter has to be enabled.
The object interface to manage the SDK Javascript Web Console logs.


SkylinkLogs.clearAllLogs

()
global
  Defined in: source/skylink-debug.js:219      Available since 0.5.5

Function that clears all the current stored SDK console logs.

Example:

        

// Example 1: Clear all the logs SkylinkLogs.clearAllLogs();


SkylinkLogs.getLogs

()
global
  Defined in: source/skylink-debug.js:192      Available since 0.5.5

Function that gets the current stored SDK console logs.

Parameters:

  • logLevel {Number} Optional

    The specific log level of logs to return.

    • When not provided or that the level does not exists, it will return all logs of all levels. [Rel: Skylink.LOG_LEVEL]

Returns:

{Array}:

The array of stored logs.

  • <#index>{Array}

    The stored log item.

    • 0{Date}

      The DateTime of when the log was stored.

    • 1{String}

      The log level. [Rel: Skylink.LOG_LEVEL]

    • 2{String}

      The log message.

    • 3{Any}Optional

      The log message object.

Example:

        

// Example 1: Get logs of specific level var debugLogs = SkylinkLogs.getLogs(skylinkDemo.LOG_LEVEL.DEBUG);

// Example 2: Get all the logs var allLogs = SkylinkLogs.getLogs();


SkylinkLogs.printAllLogs

()
global
  Defined in: source/skylink-debug.js:233      Available since 0.5.5

Function that prints all the current stored SDK console logs into the Javascript Web Console.

Example:

        

// Example 1: Print all the logs SkylinkLogs.printAllLogs();


_appKeyOwner

Attribute Type: {String}
private
  Defined in: source/template/header.js:570      Available since 0.5.2

Stores the "apiOwner" used for joinRoom().


_autoIntroduce

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:304      Available since 0.6.1

Stores the flag that indicates if "autoIntroduce" is enabled. If enabled, the Peers connecting the same Room will receive each others "enter" message ping.

Default value:

true

_bandwidthAdjuster

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:817      Available since 0.6.18

Stores the auto bandwidth settings.


_BINARY_FILE_SIZE

Attribute Type: {Number}
private readonly
  Defined in: source/constants.js:1353      Available since 0.6.16

Stores the data chunk size for binary Blob transfers.


_binaryChunkType

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:797      Available since 0.6.18

Stores the datachannel binary data chunk type.


_channelOpen

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:460      Available since 0.5.2

Stores the flag that indicates if socket connection to the Signaling has opened.


_CHUNK_DATAURL_SIZE

Attribute Type: {Number}
private readonly
  Defined in: source/constants.js:1375      Available since 0.5.2

Stores the data chunk size for data URI string transfers.


_CHUNK_FILE_SIZE

Attribute Type: {Number}
private readonly
  Defined in: source/constants.js:1330      Available since 0.5.2

Stores the data chunk size for Blob transfers.


_clientId

Attribute Type: {Number}
private
  Defined in: source/template/header.js:860      Available since 0.6.31

Stores the unique random number used for generating the "client_id".


_currentCodecSupport

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:766      Available since 0.6.18

Stores the currently supported codecs.


_currentRecordingId

Attribute Type: {JSON}
private beta
  Defined in: source/template/header.js:743      Available since 0.6.16

Stores the current active recording session ID. There can only be 1 recording session at a time in a Room


_dataChannels

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:127      Available since 0.2.0

Stores the list of Peer Datachannel connections.

Keys:

  • #peerId {JSON}

    The list of Datachannels associated with Peer ID.

    • #channelLabel {RTCDataChannel}

      The Datachannel connection. The property name "main" is reserved for messaging Datachannel type.


_dataStreams

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:151      Available since 0.6.18

Stores the list of sending data streaming sessions to Peers.

Keys:

  • #streamId {JSON}

    The data stream session.


_dataTransfers

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:140      Available since 0.6.16

Stores the list of data transfers from / to Peers.

Keys:

  • #transferId {JSON}

    The data transfer session.


_DC_PROTOCOL_TYPE

Attribute Type: {JSON}
private readonly
  Defined in: source/constants.js:1386      Available since 0.5.2

Stores the list of data transfer protocols.

Keys:

  • WRQ {String}

    The protocol to initiate data transfer.

  • ACK {String}

    The protocol to request for data transfer chunk. Give -1 to reject the request at the beginning and 0 to accept the data transfer request.

  • CANCEL {String}

    The protocol to terminate data transfer.

  • ERROR {String}

    The protocol when data transfer has errors and has to be terminated.

  • MESSAGE {String}

    The protocol that is used to send P2P messages.


_enableDebugMode

Attribute Type: {Boolean}
private scoped
  Defined in: source/skylink-debug.js:37      Available since 0.5.4

Stores the flag if debugging mode is enabled. This manipulates the SkylinkLogs interface.

Default value:

false

_enableDebugStack

Attribute Type: {Boolean}
private scoped
  Defined in: source/skylink-debug.js:50      Available since 0.5.5

Stores the flag if logs should be stored in SkylinkLogs interface.

Default value:

false

_enableDebugTrace

Attribute Type: {Boolean}
private scoped
  Defined in: source/skylink-debug.js:62      Available since 0.5.5

Stores the flag if logs should trace if available. This uses the console.trace API.

Default value:

false

_enableIceRestart

Attribute Type: {String}
private
  Defined in: source/template/header.js:520      Available since 0.6.16

Stores the value if ICE restart is supported.


_EVENTS

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:370      Available since 0.5.2

Stores the list of on() event handlers.

Keys:

  • <#event> {Array}

    The list of event handlers associated with the event.

    • <#index> {Function}

      The event handler function.


_gatheredCandidates

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:185      Available since 0.6.14

Stores the list of Peer connection ICE candidates.

Keys:

  • <#peerId> {JSON}

    The list of the Peer connection ICE candidates.

    • sending {JSON}

      The list of the Peer connection ICE candidates sent.

    • receiving {JSON}

      The list of the Peer connection ICE candidates received.


_GROUP_MESSAGE_LIST

Attribute Type: {Array}
private readonly
  Defined in: source/constants.js:1450      Available since 0.5.10

Stores the list of socket messaging protocol types to queue when sent less than a second interval.


_hasMCU

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:530      Available since 0.5.4

Stores the flag if MCU environment is enabled.


_initOptions

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:850      Available since 0.6.27

Stores the init() configuration.


_inRoom

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:360      Available since 0.4.0

Stores the flag that indicates if User is connected to the Room.


_joinRoomManager

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:837      Available since 0.6.19

Stores the flag to temporarily halt joinRoom() from processing.


_key

Attribute Type: {String}
private
  Defined in: source/template/header.js:560      Available since 0.1.0

Stores the "cid" used for joinRoom().


_LOG_KEY

Attribute Type: {String}
private scoped
  Defined in: source/skylink-debug.js:1      Available since 0.5.4

Stores the log message starting header string. E.g. "

- ".


_LOG_LEVELS

Attribute Type: {Array}
private scoped
  Defined in: source/skylink-debug.js:13      Available since 0.5.5

Stores the list of available SDK log levels.


_logLevel

Attribute Type: {String}
private scoped
  Defined in: source/skylink-debug.js:24      Available since 0.5.4

Stores the current SDK log level. Default is ERROR (0).

Default value:

0

_MOZ_BINARY_FILE_SIZE

Attribute Type: {Number}
private readonly
  Defined in: source/constants.js:1364      Available since 0.6.16

Stores the data chunk size for binary Blob transfers.


_MOZ_CHUNK_FILE_SIZE

Attribute Type: {Number}
private readonly
  Defined in: source/constants.js:1341      Available since 0.5.2

Stores the data chunk size for Blob transfers transferring from/to Firefox browsers due to limitation tested in the past in some PCs (linx predominatly).


_onceEvents

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:382      Available since 0.5.4

Stores the list of once() event handlers. These events are only triggered once.

Keys:

  • <#event> {Array}

    The list of event handlers associated with the event.

    • <#index> {Array}

      The array of event handler function and its condition function.


_parentId

Attribute Type: {String}
private
  Defined in: source/template/header.js:722      Available since 0.6.18

Stores the parent ID.


_path

Attribute Type: {String}
private
  Defined in: source/template/header.js:540      Available since 0.1.0

Stores the construct API REST path to obtain Room credentials.


_peerBandwidth

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:231      Available since 0.6.16

Stores the list of the Peer connections stats.

Keys:

  • <#peerId> {JSON}

    The Peer connection stats.


_peerCandidatesQueue

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:162      Available since 0.5.1

Stores the list of buffered ICE candidates that is received before remote session description is received and set.

Keys:

  • <#peerId> {Array}

    The list of the Peer connection buffered ICE candidates received.

    • <#index> {RTCIceCandidate}

      The Peer connection buffered ICE candidate received.


_peerConnectionConfig

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:807      Available since 0.6.18

Stores the RTCPeerConnection configuration.


_peerConnections

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:209      Available since 0.1.0

Stores the list of the Peer connections.

Keys:

  • <#peerId> {RTCPeerConnection}

    The Peer connection.


_peerConnStatus

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:827      Available since 0.6.19

Stores the Peer connection status.


_peerCustomConfigs

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:242      Available since 0.6.18

Stores the list of the Peer custom configs.


_peerEndOfCandidatesCounter

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:175      Available since 0.6.16

Stores the list of ICE candidates received before signaling end.


_peerInformations

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:252      Available since 0.3.0

Stores the list of Peers session information.

Keys:

  • <#peerId> {JSON}

    The Peer session information.

    • userData {JSON | String}

      The Peer custom data.

    • settings {JSON}

      The Peer streaming information.

    • mediaStatus {JSON}

      The Peer streaming muted status.

    • agent {JSON}

      The Peer agent information.


_peerList

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:330      Available since 0.6.1

Stores the list of Peers retrieved from the Signaling from getPeers() method.


_peerMessagesStamps

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:596      Available since 0.6.15

Stores the list of Peer messages timestamp.


_peerPriorityWeight

Attribute Type: {Number}
private
  Defined in: source/template/header.js:293      Available since 0.5.0

Stores the User connection priority weight. If Peer has a higher connection weight, it will do the offer from its Peer connection first.


_peerStats

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:220      Available since 0.6.16

Stores the list of the Peer connections stats.

Keys:

  • <#peerId> {JSON}

    The Peer connection stats.


_printTimestamp

Attribute Type: {Boolean}
private scoped
  Defined in: source/skylink-debug.js:75      Available since 0.6.26

Stores the flag if logs should print timestamp.

Default value:

false

_publishOnly

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:712      Available since 0.6.16

Stores the publish only settings.


_readyState

Attribute Type: {Number}
private
  Defined in: source/template/header.js:550      Available since 0.1.0

Stores the current init() readyState.


_recordings

Attribute Type: {JSON}
private beta
  Defined in: source/template/header.js:732      Available since 0.6.16

Stores the list of recordings.


_recordingStartInterval

Attribute Type: {JSON}
private beta
  Defined in: source/template/header.js:755      Available since 0.6.16

Stores the recording session timeout to ensure 4 seconds has been recorded.


_retryCounters

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:198      Available since 0.5.10

Stores the global number of Peer connection retries that would increase the wait-for-response timeout for the Peer connection health timer.


_room

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:580      Available since 0.5.2

Stores the Room credentials information for joinRoom().

Keys:

  • id {String}

    The "rid" for joinRoom().

  • token {String}

    The "roomCred" for joinRoom().

  • startDateTime {String}

    The "start" for joinRoom().

  • duration {String}

    The "len" for joinRoom().

  • connection {String}

    The RTCPeerConnection constraints and configuration. This is not used in the SDK except for the "mediaConstraints" property that sets the default getUserMedia() settings.


_roomLocked

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:350      Available since 0.5.2

Stores the flag that indicates if Room is locked.


_sdpSessions

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:776      Available since 0.6.18

Stores the session description orders and info.


_sdpSettings

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:692      Available since 0.6.16

Stores the session description settings.


_selectedRoom

Attribute Type: {String}
private
  Defined in: source/template/header.js:340      Available since 0.3.0

Stores the current Room name that User is connected to.


_SIG_MESSAGE_TYPE

Attribute Type: {JSON}
private readonly
  Defined in: source/constants.js:1410      Available since 0.5.6

Stores the list of socket messaging protocol types. See confluence docs for the list based on the current SM_PROTOCOL_VERSION.


_signalingServer

Attribute Type: {String}
private
  Defined in: source/template/header.js:470      Available since 0.5.2

Stores the Signaling server url.


_signalingServerPort

Attribute Type: {Number}
private
  Defined in: source/template/header.js:490      Available since 0.5.4

Stores the Signaling server port.


_signalingServerProtocol

Attribute Type: {String}
private
  Defined in: source/template/header.js:480      Available since 0.5.4

Stores the Signaling server protocol.


_socket

Attribute Type: {Io}
private
  Defined in: source/template/header.js:500      Available since 0.1.0

Stores the Signaling socket connection object.


_socketMessageQueue

Attribute Type: {Array}
private
  Defined in: source/template/header.js:421      Available since 0.5.8

Stores the queued socket messages. This is to prevent too many sent over less than a second interval that might cause dropped messages or jams to the Signaling connection.


_socketMessageTimeout

Attribute Type: {Object}
private
  Defined in: source/template/header.js:433      Available since 0.5.8

Stores the setTimeout to sent queued socket messages.


_socketPorts

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:443      Available since 0.5.8

Stores the list of socket ports to use to connect to the Signaling. These ports are defined by default which is commonly used currently by the Signaling. Should re-evaluate this sometime.

Keys:

  • http: {Array}

    The list of HTTP socket ports.

  • https: {Array}

    The list of HTTPS socket ports.


_socketSession

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:411      Available since 0.6.13

Stores the current socket connection information.


_socketUseXDR

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:510      Available since 0.5.4

Stores the flag that indicates if XDomainRequest is used for IE 8/9.


_storedLogs

Attribute Type: {Array}
private scoped
  Defined in: source/skylink-debug.js:87      Available since 0.5.5

Stores the logs used for SkylinkLogs object.


_streams

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:606      Available since 0.6.15

Stores the Streams.


_streamsBandwidthSettings

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:658      Available since 0.6.15

Stores all the Stream sending maximum bandwidth settings.


_streamsDefaultSettings

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:619      Available since 0.6.15

Stores the default camera Stream settings.


_streamsMutedSettings

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:645      Available since 0.6.15

Stores all the Stream required muted settings.


_streamsSession

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:681      Available since 0.6.15

Stores all the Stream sessions. Defined as false when Stream has already ended.


_streamsStoppedCbs

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:671      Available since 0.6.15

Stores all the Stream stopped callbacks.


_timestamp

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:395      Available since 0.5.8

Stores the timestamps data used for throttling.


_user

Attribute Type: {JSON}
private
  Defined in: source/template/header.js:267      Available since 0.5.6

Stores the Signaling user credentials from the API response required for connecting to the Signaling server.

Keys:

  • uid {String}

    The API result "username".

  • token {String}

    The API result "userCred".

  • timeStamp {String}

    The API result "timeStamp".

  • sid {String}

    The Signaling server receive user Peer ID.


_userData

Attribute Type: {JSON | String}
private
  Defined in: source/template/header.js:281      Available since 0.5.6

Stores the User custom data. By default, if no custom user data is set, it is an empty string "".

Default value:

""

_userInfo

Attribute Type: {JSON}
private scoped
  Defined in: source/skylink-debug.js:98      Available since 0.6.35

Stores the user's info for reporting error to API


_voiceActivityDetection

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:786      Available since 0.6.18

Stores the flag if voice activity detection should be enabled.

Default value:

true

AUDIO_CODEC

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:1086      Available since 0.5.10

Note that if the audio codec is not supported, the SDK will not configure the local "offer" or "answer" session description to prefer the codec.
The list of available audio codecs to set as the preferred audio codec to use to encode sending audio data when available encoded audio codec for Peer connections configured in the init() method.

Keys:

  • AUTO {String}

    Value "auto" The value of the option to not prefer any audio codec but rather use the created local "offer" / "answer" session description audio codec preference.

  • OPUS {String}

    Value "opus" The value of the option to prefer the OPUS audio codec.

  • ISAC {String}

    Value "ISAC" The value of the option to prefer the ISAC audio codec.

  • ILBC {String}

    Value "ILBC" The value of the option to prefer the iLBC audio codec.

  • G722 {String}

    Value "G722" The value of the option to prefer the G722 audio codec.

  • PCMA {String}

    Value "PCMA" The value of the option to prefer the G711u audio codec.

  • PCMU {String}

    Value "PCMU" The value of the option to prefer the G711a audio codec.


BUNDLE_POLICY

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:510      Available since 0.6.18

Learn more about how ICE works in this article here.
The list of available Peer connection bundle policies.

Keys:

  • MAX_COMPAT {String}

    Value "max-compat" The value of the bundle policy to generate ICE candidates for each media type so each media type flows through different transports.

  • MAX_BUNDLE {String}

    Value "max-bundle" The value of the bundle policy to generate ICE candidates for one media type so all media type flows through a single transport.

  • BALANCED {String}

    Value "balanced" The value of the bundle policy to use MAX_BUNDLE if Peer supports it, else fallback to MAX_COMPAT.

  • NONE {String}

    Value "none" The value of the bundle policy to not use any media bundle. This removes the a=group:BUNDLE line from session descriptions.


CANDIDATE_GENERATION_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:272      Available since 0.4.1

Learn more about how ICE works in this article here.
The list of Peer connection ICE gathering states.

Keys:

  • GATHERING {String}

    Value "gathering" The value of the state when Peer connection is gathering ICE candidates. These ICE candidates are sent to Peer for its connection to check for a suitable matching pair of ICE candidates to establish an ICE connection for stream audio, video and data. See iceConnectionState event for ICE connection status. This state cannot happen until Peer connection remote "offer" / "answer" session description is set. See peerConnectionState event for session description exchanging status.

  • COMPLETED {String}

    Value "completed" The value of the state when Peer connection gathering of ICE candidates has completed.


CANDIDATE_PROCESSING_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:300      Available since 0.6.16

Learn more about how ICE works in this article here.
The list of Peer connection remote ICE candidate processing states for trickle ICE connections.

Keys:

  • RECEIVED {String}

    Value "received" The value of the state when the remote ICE candidate was received.

  • DROPPED {String}

    Value "received" The value of the state when the remote ICE candidate is dropped.

  • BUFFERED {String}

    Value "buffered" The value of the state when the remote ICE candidate is buffered.

  • PROCESSING {String}

    Value "processing" The value of the state when the remote ICE candidate is being processed.

  • PROCESS_SUCCESS {String}

    Value "processSuccess" The value of the state when the remote ICE candidate has been processed successfully. The ICE candidate that is processed will be used to check against the list of locally generated ICE candidate to start matching for the suitable pair for the best ICE connection.

  • PROCESS_ERROR {String}

    Value "processError" The value of the state when the remote ICE candidate has failed to be processed.


DATA_CHANNEL_MESSAGE_ERROR

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:73      Available since 0.6.16

The list of Datachannel sending message error types.

Keys:

  • MESSAGE {String}

    Value "message" The value of the Datachannel sending message error type when encountered during sending P2P message from sendP2PMessage() method.

  • TRANSFER {String}

    Value "transfer" The value of the Datachannel sending message error type when encountered during data transfers from sendURLData() method or sendBlobData() method.


DATA_CHANNEL_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:1      Available since 0.1.0

The list of Datachannel connection states.

Keys:

  • CONNECTING {String}

    Value "connecting" The value of the state when Datachannel is attempting to establish a connection.

  • OPEN {String}

    Value "open" The value of the state when Datachannel has established a connection.

  • CLOSING {String}

    Value "closing" The value of the state when Datachannel connection is closing.

  • CLOSED {String}

    Value "closed" The value of the state when Datachannel connection has closed.

  • ERROR {String}

    Value "error" The value of the state when Datachannel has encountered an exception during connection.

  • CREATE_ERROR {String}

    Value "createError" The value of the state when Datachannel has failed to establish a connection.

  • BUFFERED_AMOUNT_LOW {String}

    Value "bufferedAmountLow" The value of the state when Datachannel when the amount of data buffered to be sent falls below the Datachannel threshold. This state should occur only during after sendBlobData() method or sendURLData() method or sendP2PMessage() method.

  • SEND_MESSAGE_ERROR {String}

    Value "sendMessageError" The value of the state when Datachannel when data transfer packets or P2P message fails to send. This state should occur only during after sendBlobData() method or sendURLData() method or sendP2PMessage() method.


DATA_CHANNEL_TYPE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:43      Available since 0.6.1

The list of Datachannel types.

Keys:

  • MESSAGING {String}

    Value "messaging" The value of the Datachannel type that is used only for messaging in sendP2PMessage() method. However for Peers that do not support simultaneous data transfers, this Datachannel type will be used to do data transfers (1 at a time). Each Peer connections will only have one of this Datachannel type and the connection will only close when the Peer connection is closed (happens when peerConnectionState event triggers parameter payload state as CLOSED for Peer).

  • DATA {String}

    Value "data" The value of the Datachannel type that is used only for a data transfer in sendURLData() method and sendBlobData() method. The connection will close after the data transfer has been completed or terminated (happens when dataTransferState event triggers parameter payload state as DOWNLOAD_COMPLETED, UPLOAD_COMPLETED, REJECTED, CANCEL or ERROR for Peer).


DATA_STREAM_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:235      Available since 0.6.18

The list of data streaming states.

Keys:

  • SENDING_STARTED {String}

    Value "sendStart" The value of the state when data streaming session has started from User to Peer.

  • RECEIVING_STARTED {String}

    Value "receiveStart" The value of the state when data streaming session has started from Peer to Peer.

  • RECEIVED {String}

    Value "received" The value of the state when data streaming session data chunk has been received from Peer to User.

  • SENT {String}

    Value "sent" The value of the state when data streaming session data chunk has been sent from User to Peer.

  • SENDING_STOPPED {String}

    Value "sendStop" The value of the state when data streaming session has stopped from User to Peer.

  • RECEIVING_STOPPED {String}

    Value "receivingStop" The value of the state when data streaming session has stopped from Peer to User.

  • ERROR {String}

    Value "error" The value of the state when data streaming session has errors. At this stage, the data streaming state is considered SENDING_STOPPED or RECEIVING_STOPPED.

  • START_ERROR {String}

    Value "startError" The value of the state when data streaming session failed to start from User to Peer.


DATA_TRANSFER_DATA_TYPE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:93      Available since 0.1.0

The list of supported data transfer data types.

Keys:

  • BINARY_STRING {String}

    Value "binaryString" The value of data transfer data type when Blob binary data chunks encoded to Base64 encoded string are sent or received over the Datachannel connection for the data transfer session. Used only in sendBlobData() method when parameter sendChunksAsBinary value is false.

  • ARRAY_BUFFER {String}

    Value "arrayBuffer" The value of data transfer data type when ArrayBuffer binary data chunks are sent or received over the Datachannel connection for the data transfer session. Used only in sendBlobData() method when parameter sendChunksAsBinary value is true.

  • BLOB {String}

    Value "blob" The value of data transfer data type when Blob binary data chunks are sent or received over the Datachannel connection for the data transfer session. Used only in sendBlobData() method when parameter sendChunksAsBinary value is true.

  • STRING {String}

    Value "string" The value of data transfer data type when only string data chunks are sent or received over the Datachannel connection for the data transfer session. Used only in sendURLData() method.


DATA_TRANSFER_SESSION_TYPE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:158      Available since 0.1.0

The list of data transfers session types.

Keys:


DATA_TRANSFER_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:177      Available since 0.4.0

The list of data transfer states.

Keys:

  • UPLOAD_REQUEST {String}

    Value "request" The value of the state when receiving an upload data transfer request from Peer to User. At this stage, the upload data transfer request from Peer may be accepted or rejected with the acceptDataTransfer() method invoked by User.

  • USER_UPLOAD_REQUEST {String}

    Value "userRequest" The value of the state when User sent an upload data transfer request to Peer. At this stage, the upload data transfer request to Peer may be accepted or rejected with the acceptDataTransfer() method invoked by Peer.

  • UPLOAD_STARTED {String}

    Value "uploadStarted" The value of the state when the data transfer request has been accepted and data transfer will start uploading data to Peer. At this stage, the data transfer may be terminated with the cancelDataTransfer() method.

  • DOWNLOAD_STARTED {String}

    Value "downloadStarted" The value of the state when the data transfer request has been accepted and data transfer will start downloading data from Peer. At this stage, the data transfer may be terminated with the cancelDataTransfer() method.

  • REJECTED {String}

    Value "rejected" The value of the state when upload data transfer request to Peer has been rejected and terminated.

  • USER_REJECTED {String}

    Value "userRejected" The value of the state when User rejected and terminated upload data transfer request from Peer.

  • UPLOADING {String}

    Value "uploading" The value of the state when data transfer is uploading data to Peer.

  • DOWNLOADING {String}

    Value "downloading" The value of the state when data transfer is downloading data from Peer.

  • UPLOAD_COMPLETED {String}

    Value "uploadCompleted" The value of the state when data transfer has uploaded successfully to Peer.

  • DOWNLOAD_COMPLETED {String}

    Value "downloadCompleted" The value of the state when data transfer has downloaded successfully from Peer.

  • CANCEL {String}

    Value "cancel" The value of the state when data transfer has been terminated from / to Peer.

  • ERROR {String}

    Value "error" The value of the state when data transfer has errors and has been terminated from / to Peer.


DATA_TRANSFER_TYPE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:141      Available since 0.1.0

The list of data transfers directions.

Keys:

  • UPLOAD {String}

    Value "upload" The value of the data transfer direction when User is uploading data to Peer.

  • DOWNLOAD {String}

    Value "download" The value of the data transfer direction when User is downloading data from Peer.


DT_PROTOCOL_VERSION

Attribute Type: {String}
readonly
  Defined in: source/constants.js:127      Available since 0.5.10

Note that this is used only for SDK developer purposes.
Current version: 0.1.0
The value of the current version of the data transfer protocol.


GET_CONNECTION_STATUS_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:470      Available since 0.1.0

The list of getConnectionStatus() method retrieval states.

Keys:

  • RETRIEVING {Number}

    Value 0 The value of the state when getConnectionStatus() is retrieving the Peer connection stats.

  • RETRIEVE_SUCCESS {Number}

    Value 1 The value of the state when getConnectionStatus() has retrieved the Peer connection stats successfully.

  • RETRIEVE_ERROR {Number}

    Value -1 The value of the state when getConnectionStatus() has failed retrieving the Peer connection stats.


GET_PEERS_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:620      Available since 0.6.1

Note that this feature requires "isPrivileged" flag to be enabled for the App Key provided in the init() method, as only Users connecting using the App Key with this flag enabled (which we call privileged Users / Peers) can retrieve the list of Peer IDs from Rooms within the same App space. Read more about privileged App Key feature here.
The list of getPeers() method retrieval states.

Keys:

  • ENQUIRED {String}

    Value "enquired" The value of the state when getPeers() is retrieving the list of Peer IDs from Rooms within the same App space from the Signaling server.

  • RECEIVED {String}

    Value "received" The value of the state when getPeers() has retrieved the list of Peer IDs from Rooms within the same App space from the Signaling server successfully.


HANDSHAKE_PROGRESS

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:586      Available since 0.1.0

The list of Peer connection states.

Keys:

  • ENTER {String}

    Value "enter" The value of the connection state when Peer has just entered the Room. At this stage, peerJoined event is triggered.

  • WELCOME {String}

    Value "welcome" The value of the connection state when Peer is aware that User has entered the Room. At this stage, peerJoined event is triggered and Peer connection may commence.

  • OFFER {String}

    Value "offer" The value of the connection state when Peer connection has set the local / remote "offer" session description to start streaming connection.

  • ANSWER {String}

    Value "answer" The value of the connection state when Peer connection has set the local / remote "answer" session description to establish streaming connection.

  • ERROR {String}

    Value "error" The value of the connection state when Peer connection has failed to establish streaming connection. This happens when there are errors that occurs in creating local "offer" / "answer", or when setting remote / local "offer" / "answer".


ICE_CONNECTION_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:335      Available since 0.1.0

Learn more about how ICE works in this article here.
The list of Peer connection ICE connection states.

Keys:

  • CHECKING {String}

    Value "checking" The value of the state when Peer connection is checking for a suitable matching pair of ICE candidates to establish ICE connection. Exchanging of ICE candidates happens during candidateGenerationState event.

  • CONNECTED {String}

    Value "connected" The value of the state when Peer connection has found a suitable matching pair of ICE candidates to establish ICE connection but is still checking for a better suitable matching pair of ICE candidates for the best ICE connectivity. At this state, ICE connection is already established and audio, video and data streaming has already started.

  • COMPLETED {String}

    Value "completed" The value of the state when Peer connection has found the best suitable matching pair of ICE candidates to establish ICE connection and checking has stopped. At this state, ICE connection is already established and audio, video and data streaming has already started. This may happpen after CONNECTED.

  • FAILED {String}

    Value "failed" The value of the state when Peer connection ICE connection has failed.

  • DISCONNECTED {String}

    Value "disconnected" The value of the state when Peer connection ICE connection is disconnected. At this state, the Peer connection may attempt to revive the ICE connection. This may happen due to flaky network conditions.

  • CLOSED {String}

    Value "closed" The value of the state when Peer connection ICE connection has closed. This happens when Peer connection is closed and no streaming can occur at this stage.

  • TRICKLE_FAILED {String}

    Value "trickeFailed" The value of the state when Peer connection ICE connection has failed during trickle ICE. Trickle ICE is enabled in init() method enableIceTrickle option.


INTRODUCE_STATE

Attribute Type: {}
readonly
  Defined in: source/constants.js:647      Available since 0.6.1

Note that this feature requires "isPrivileged" flag to be enabled and "autoIntroduce" flag to be disabled for the App Key provided in the init() method, as only Users connecting using the App Key with this flag enabled (which we call privileged Users / Peers) can retrieve the list of Peer IDs from Rooms within the same App space. Read more about privileged App Key feature here.
The list of introducePeer method Peer introduction request states.

Keys:

  • INTRODUCING {String}

    Value "enquired" The value of the state when introduction request for the selected pair of Peers has been made to the Signaling server.

  • ERROR {String}

    Value "error" The value of the state when introduction request made to the Signaling server for the selected pair of Peers has failed.


isPrivileged

Attribute Type: {Boolean}
private
  Defined in: source/template/header.js:316      Available since 0.6.1

Stores the flag that indicates if "isPrivileged" is enabled. If enabled, the User has Privileged features which has the ability to retrieve the list of Peers in the same App space with getPeers() method and introduce Peers to each other with introducePeer method.

Default value:

false

log

Attribute Type: {JSON}
private scoped
  Defined in: source/skylink-debug.js:349      Available since 0.5.4

Stores the logging functions.

Keys:

  • debug {Function}

    The function that handles the DEBUG level logs.

  • log {Function}

    The function that handles the LOG level logs.

  • info {Function}

    The function that handles the INFO level logs.

  • warn {Function}

    The function that handles the WARN level logs.

  • error {Function}

    The function that handles the ERROR level logs.


LOG_LEVEL

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:944      Available since 0.5.4

The list of the SDK console API log levels.

Keys:

  • DEBUG {Number}

    Value 4 The value of the log level that displays console debug, log, info, warn and error logs.

  • LOG {Number}

    Value 3 The value of the log level that displays only console log, info, warn and error logs.

  • INFO {Number}

    Value 2 The value of the log level that displays only console info, warn and error logs.

  • WARN {Number}

    Value 1 The value of the log level that displays only console warn and error logs.

  • ERROR {Number}

    Value 0 The value of the log level that displays only console error logs.

  • NONE {Number}

    Value -1 The value of the log level that displays no logs.


MEDIA_ACCESS_FALLBACK_STATE

Attribute Type: {}
readonly
  Defined in: source/constants.js:1279      Available since 0.6.14

The list of getUserMedia() method or shareScreen() method Stream fallback states.

Keys:

  • FALLBACKING {JSON}

    Value 0 The value of the state when getUserMedia() will retrieve audio track only when retrieving audio and video tracks failed. This can be configured by init() method audioFallback option.

  • FALLBACKED {JSON}

    Value 1 The value of the state when getUserMedia() or shareScreen() retrieves camera / screensharing Stream successfully but with missing originally required audio or video tracks.

  • ERROR {JSON}

    Value -1 The value of the state when getUserMedia() failed to retrieve audio track only after retrieving audio and video tracks failed.


MEDIA_SOURCE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:1126      Available since 0.5.10

The list of available screensharing media sources configured in the shareScreen() method.

Keys:

  • SCREEN {String}

    Value "screen" The value of the option to share entire screen.

  • WINDOW {String}

    Value "window" The value of the option to share application windows.

  • TAB {String}

    Value "tab" The value of the option to share browser tab. Note that this is only supported by from Chrome 52+ and Opera 39+.

  • TAB_AUDIO {String}

    Value "audio" The value of the option to share browser tab audio. Note that this is only supported by Chrome 52+ and Opera 39+. options.audio has to be enabled with TAB also requested to enable sharing of tab audio.

  • APPLICATION {String}

    Value "application" The value of the option to share applications. Note that this is only supported by Firefox currently.

  • BROWSER {String}

    Value "browser" The value of the option to share browser. Note that this is only supported by Firefox currently, and requires toggling the media.getUserMedia.browser.enabled in about:config.

  • CAMERA {String}

    Value "camera" The value of the option to share camera. Note that this is only supported by Firefox currently.


PEER_CERTIFICATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:562      Available since 0.6.18

Learn more about how ICE works in this article here.
The list of available Peer connection certificates cryptographic algorithm to use.

Keys:

  • RSA {String}

    Value "RSA" The value of the Peer connection certificate algorithm to use RSA-1024.

  • ECDSA {String}

    Value "ECDSA" The value of the Peer connection certificate algorithm to use ECDSA.

  • AUTO {String}

    Value "AUTO" The value of the Peer connection to use the default certificate generated.


PEER_CONNECTION_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:435      Available since 0.5.0

Learn more about how ICE works in this article here.
The list of Peer connection session description exchanging states.

Keys:

  • STABLE {String}

    Value "stable" The value of the state when there is no session description being exchanged between Peer connection.

  • HAVE_LOCAL_OFFER {String}

    Value "have-local-offer" The value of the state when local "offer" session description is set. This should transition to STABLE state after remote "answer" session description is set. See handshakeProgress event for a more detailed exchanging of session description states.

  • HAVE_REMOTE_OFFER {String}

    Value "have-remote-offer" The value of the state when remote "offer" session description is set. This should transition to STABLE state after local "answer" session description is set. See handshakeProgress event for a more detailed exchanging of session description states.

  • CLOSED {String}

    Value "closed" The value of the state when Peer connection is closed and no session description can be exchanged and set.


PRIORITY_WEIGHT_SCHEME

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:923      Available since 0.6.18

The list of User's priority weight schemes for joinRoom() method connections.

Keys:

  • ENFORCE_OFFERER {String}

    Value "enforceOfferer" The value of the priority weight scheme to enforce User as the offerer.

  • ENFORCE_ANSWERER {String}

    Value "enforceAnswerer" The value of the priority weight scheme to enforce User as the answerer.

  • AUTO {String}

    Value "auto" The value of the priority weight scheme to let User be offerer or answerer based on Signaling server selection.


READY_STATE_CHANGE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:776      Available since 0.1.0

The list of init() method ready states.

Keys:

  • INIT {Number}

    Value 0 The value of the state when init() has just started.

  • LOADING {Number}

    Value 1 The value of the state when init() is authenticating App Key provided (and with credentials if provided as well) with the Auth server.

  • COMPLETED {Number}

    Value 2 The value of the state when init() has successfully authenticated with the Auth server. Room session token is generated for joining the defaultRoom provided in init(). Room session token has to be generated each time User switches to a different Room in joinRoom() method.

  • ERROR {Number}

    Value -1 The value of the state when init() has failed authenticating with the Auth server. [Rel: Skylink.READY_STATE_CHANGE_ERROR]


READY_STATE_CHANGE_ERROR

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:804      Available since 0.4.0

The list of init() method ready state failure codes.

Keys:

  • API_INVALID {Number}

    Value 4001 The value of the failure code when provided App Key in init() does not exists. To resolve this, check that the provided App Key exists in the Temasys Console.

  • API_DOMAIN_NOT_MATCH {Number}

    Value 4002 The value of the failure code when "domainName" property in the App Key does not match the accessing server IP address. To resolve this, contact our support portal.

  • API_CORS_DOMAIN_NOT_MATCH {Number}

    Value 4003 The value of the failure code when "corsurl" property in the App Key does not match accessing CORS. To resolve this, configure the App Key CORS in the Temasys Console.

  • API_CREDENTIALS_INVALID {Number}

    Value 4004 The value of the failure code when there is no CORS present in the HTTP headers during the request to the Auth server present nor options.credentials.credentials configuration provided in the init(). To resolve this, ensure that CORS are present in the HTTP headers during the request to the Auth server.

  • API_CREDENTIALS_NOT_MATCH {Number}

    Value 4005 The value of the failure code when the options.credentials.credentials configuration provided in the init() does not match up with the options.credentials.startDateTime, options.credentials.duration or that the "secret" used to generate options.credentials.credentials does not match the App Key's "secret property provided. To resolve this, check that the options.credentials.credentials is generated correctly and that the "secret" used to generate it is from the App Key provided in the init().

  • API_INVALID_PARENT_KEY {Number}

    Value 4006 The value of the failure code when the App Key provided does not belong to any existing App. To resolve this, check that the provided App Key exists in the Developer Console.

  • API_NO_MEETING_RECORD_FOUND {Number}

    Value 4010 The value of the failure code when provided options.credentials does not match any scheduled meetings available for the "Persistent Room" enabled App Key provided. See the Persistent Room article to learn more.

  • API_OVER_SEAT_LIMIT {Number}

    Value 4020 The value of the failure code when App Key has reached its current concurrent users limit. To resolve this, use another App Key. To create App Keys dynamically, see the Application REST API docs for more information.

  • API_RETRIEVAL_FAILED {Number}

    Value 4021 The value of the failure code when App Key retrieval of authentication token fails. If this happens frequently, contact our support portal.

  • API_WRONG_ACCESS_DOMAIN {Number}

    Value 5005 The value of the failure code when App Key makes request to the incorrect Auth server. To resolve this, ensure that the roomServer is not configured. If this persists even without roomServer configuration, contact our support portal.

  • XML_HTTP_REQUEST_ERROR {Number}

    Value -1 The value of the failure code when requesting to Auth server has timed out.

  • XML_HTTP_NO_REPONSE_ERROR {Number}

    Value -2 The value of the failure code when response from Auth server is empty or timed out.

  • NO_SOCKET_IO {Number}

    Value 1 The value of the failure code when dependency Socket.IO client is not loaded. To resolve this, ensure that the Socket.IO client dependency is loaded before the Skylink SDK. You may use the provided Socket.IO client CDN here.

  • NO_XMLHTTPREQUEST_SUPPORT {Number}

    Value 2 The value of the failure code when XMLHttpRequest API required to make request to Auth server is not supported. To resolve this, display in the Web UI to ask clients to switch to the list of supported browser as listed in here.

  • NO_WEBRTC_SUPPORT {Number}

    Value 3 The value of the failure code when RTCPeerConnection API required for Peer connections is not supported. To resolve this, display in the Web UI to ask clients to switch to the list of supported browser as listed in here. For plugin supported browsers, if the clients does not have the plugin installed, there will be an installation toolbar that will prompt for installation to support the RTCPeerConnection API.

  • NO_PATH {Number}

    Value 4 The value of the failure code when provided init() configuration has errors.

  • ADAPTER_NO_LOADED {Number}

    Value 7 The value of the failure code when dependency AdapterJS is not loaded. To resolve this, ensure that the AdapterJS dependency is loaded before the Skylink dependency. You may use the provided AdapterJS CDN here.

  • PARSE_CODECS {Number}

    Value 8 The value of the failure code when codecs support cannot be parsed and retrieved.


RECORDING_STATE

Attribute Type: {JSON}
beta
  Defined in: source/constants.js:1304      Available since 0.6.16

The list of recording states.

Keys:

  • START {Number}

    Value 0 The value of the state when recording session has started.

  • STOP {Number}

    Value 1 The value of the state when recording session has stopped.
    At this stage, the recorded videos will go through the mixin server to compile the videos.

  • LINK {Number}

    Value 2 The value of the state when recording session mixin request has been completed.

  • ERROR {Number}

    Value -1 The value of the state state when recording session has errors. This can happen during recording session or during mixin of recording videos, and at this stage, any current recording session or mixin is aborted.


REGIONAL_SERVER

Attribute Type: {JSON}
private readonly
  Defined in: source/constants.js:908      Available since 0.6.16

Spoofs the REGIONAL_SERVER to prevent errors on deployed apps except the fact this no longer works. Automatic regional selection has already been implemented hence REGIONAL_SERVER is no longer useful.


RTCP_MUX_POLICY

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:541      Available since 0.6.18

Learn more about how ICE works in this article here.
The list of available Peer connection RTCP mux policies.

Keys:

  • REQUIRE {String}

    Value "require" The value of the RTCP mux policy to generate ICE candidates for RTP only and RTCP shares the same ICE candidates.

  • NEGOTIATE {String}

    Value "negotiate" The value of the RTCP mux policy to generate ICE candidates for both RTP and RTCP each.


SERVER_PEER_TYPE

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:491      Available since 0.6.1

As there are more features getting implemented, there will be eventually more different types of server Peers.
The list of available types of server Peer connections.

Keys:

  • MCU {String}

    Value "mcu" The value of the server Peer type that is used for MCU connection.


SM_PROTOCOL_VERSION

Attribute Type: {String}
  Defined in: source/constants.js:1042      Available since 0.6.0

Note that this is used only for SDK developer purposes.
Current version: 0.1.4
The value of the current version of the Signaling socket message protocol.


SOCKET_ERROR

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:977      Available since 0.5.6

The list of joinRoom() method socket connection failure states.

Keys:

  • CONNECTION_FAILED {Number}

    Value 0 The value of the failure state when joinRoom() socket connection failed to establish with the Signaling server at the first attempt.

  • RECONNECTION_FAILED {Number}

    Value -1 The value of the failure state when joinRoom() socket connection failed to establish the Signaling server after the first attempt.

  • CONNECTION_ABORTED {Number}

    Value -2 The value of the failure state when joinRoom() socket connection will not attempt to reconnect after the failure of the first attempt in CONNECTION_FAILED as there are no more ports or transports to attempt for reconnection.

  • RECONNECTION_ABORTED {Number}

    Value -3 The value of the failure state when joinRoom() socket connection will not attempt to reconnect after the failure of several attempts in RECONNECTION_FAILED as there are no more ports or transports to attempt for reconnection.

  • RECONNECTION_ATTEMPT {Number}

    Value -4 The value of the failure state when joinRoom() socket connection is attempting to reconnect with a new port or transport after the failure of attempts in CONNECTION_FAILED or RECONNECTED_FAILED.


SOCKET_FALLBACK

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:1011      Available since 0.5.6

The list of joinRoom() method socket connection reconnection states.

Keys:

  • NON_FALLBACK {String}

    Value "nonfallback" The value of the reconnection state when joinRoom() socket connection is at its initial state without transitioning to any new socket port or transports yet.

  • FALLBACK_PORT {String}

    Value "fallbackPortNonSSL" The value of the reconnection state when joinRoom() socket connection is reconnecting with another new HTTP port using WebSocket transports to attempt to establish connection with Signaling server.

  • FALLBACK_PORT_SSL {String}

    Value "fallbackPortSSL" The value of the reconnection state when joinRoom() socket connection is reconnecting with another new HTTPS port using WebSocket transports to attempt to establish connection with Signaling server.

  • LONG_POLLING {String}

    Value "fallbackLongPollingNonSSL" The value of the reconnection state when joinRoom() socket connection is reconnecting with another new HTTP port using Polling transports to attempt to establish connection with Signaling server.

  • LONG_POLLING_SSL {String}

    Value "fallbackLongPollingSSL" The value of the reconnection state when joinRoom() socket connection is reconnecting with another new HTTPS port using Polling transports to attempt to establish connection with Signaling server.


STATS_API_VERSION

Attribute Type: {String}
readonly
  Defined in: source/constants.js:1467      Available since 0.6.31

Note that this is used only for SDK development purposes.
Current version: 1.1
The value of the current version of the stats API used.


SYSTEM_ACTION

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:673      Available since 0.5.1

The list of Signaling server reaction states during joinRoom() method.

Keys:

  • WARNING {String}

    Value "warning" The value of the state when Room session is about to end.

  • REJECT {String}

    Value "reject" The value of the state when Room session has failed to start or has ended.


SYSTEM_ACTION_REASON

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:690      Available since 0.5.2

The list of Signaling server reaction states reason of action code during joinRoom() method.

Keys:

  • CREDENTIALS_EXPIRED {String}

    Value "oldTimeStamp" The value of the reason code when Room session token has expired. Happens during joinRoom() method request. Results with: REJECT

  • CREDENTIALS_ERROR {String}

    Value "credentialError" The value of the reason code when Room session token provided is invalid. Happens during joinRoom() method request.

  • DUPLICATED_LOGIN {String}

    Value "duplicatedLogin" The value of the reason code when Room session token has been used already. Happens during joinRoom() method request. Results with: REJECT

  • ROOM_NOT_STARTED {String}

    Value "notStart" The value of the reason code when Room session has not started. Happens during joinRoom() method request. Results with: REJECT

  • EXPIRED {String}

    Value "expired" The value of the reason code when Room session has ended already. Happens during joinRoom() method request. Results with: REJECT

  • ROOM_LOCKED {String}

    Value "locked" The value of the reason code when Room is locked. Happens during joinRoom() method request. Results with: REJECT

  • FAST_MESSAGE {String}

    Value "fastmsg" The value of the reason code when User is flooding socket messages to the Signaling server that is sent too quickly within less than a second interval. Happens after Room session has started. This can be caused by various methods like sendMessage() method, setUserData() method, muteStream() method, enableAudio() method, enableVideo() method, disableAudio() method and disableVideo() method Results with: WARNING

  • ROOM_CLOSING {String}

    Value "toClose" The value of the reason code when Room session is ending. Happens after Room session has started. This serves as a prerequisite warning before ROOM_CLOSED occurs. Results with: WARNING

  • ROOM_CLOSED {String}

    Value "roomclose" The value of the reason code when Room session has just ended. Happens after Room session has started. Results with: REJECT

  • SERVER_ERROR {String}

    Value "serverError" The value of the reason code when Room session fails to start due to some technical errors. Happens during joinRoom() method request. Results with: REJECT

  • KEY_ERROR {String}

    Value "keyFailed" The value of the reason code when Room session fails to start due to some technical error pertaining to App Key initialization. Happens during joinRoom() method request. Results with: REJECT


TURN_TRANSPORT

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:387      Available since 0.5.4

Note that configuring the protocol may not necessarily result in the desired network transports protocol used in the actual TURN network traffic as it depends which protocol the browser selects and connects with. This simply configures the TURN ICE server urls query option when constructing the Peer connection. When all protocols are selected, the ICE servers urls are duplicated with all protocols.
The list of TURN network transport protocols options when constructing Peer connections configured in the init() method. Example .urls inital input: ["turn:server.com?transport=tcp", "turn:server1.com:3478", "turn:server.com?transport=udp"]

Keys:

  • TCP {String}

    Value "tcp" The value of the option to configure using only TCP network transport protocol. Example .urls output: ["turn:server.com?transport=tcp", "turn:server1.com:3478?transport=tcp"]

  • UDP {String}

    Value "udp" The value of the option to configure using only UDP network transport protocol. Example .urls output: ["turn:server.com?transport=udp", "turn:server1.com:3478?transport=udp"]

  • ANY {String}

    Value "any" The value of the option to configure using any network transport protocols configured from the Signaling server. Example .urls output: ["turn:server.com?transport=tcp", "turn:server1.com:3478", "turn:server.com?transport=udp"]

  • NONE {String}

    Value "none" The value of the option to not configure using any network transport protocols. Example .urls output: ["turn:server.com", "turn:server1.com:3478"] Configuring this does not mean that no protocols will be used, but rather removing ?transport=(protocol) query option in the TURN ICE server .urls when constructing the Peer connection.

  • ALL {String}

    Value "all" The value of the option to configure using both TCP and UDP network transport protocols. Example .urls output: ["turn:server.com?transport=tcp", "turn:server.com?transport=udp", "turn:server1.com:3478?transport=tcp", "turn:server1.com:3478?transport=udp"]


VERSION

Attribute Type: {String}
readonly
  Defined in: source/constants.js:766      Available since 0.1.0

Contains the current version of Skylink Web SDK.


VIDEO_CODEC

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:1055      Available since 0.5.10

Note that if the video codec is not supported, the SDK will not configure the local "offer" or "answer" session description to prefer the codec.
The list of available video codecs to set as the preferred video codec to use to encode sending video data when available encoded video codec for Peer connections configured in the init() method.

Keys:

  • AUTO {String}

    Value "auto" The value of the option to not prefer any video codec but rather use the created local "offer" / "answer" session description video codec preference.

  • VP8 {String}

    Value "VP8" The value of the option to prefer the VP8 video codec.

  • VP9 {String}

    Value "VP9" The value of the option to prefer the VP9 video codec.

  • H264 {String}

    Value "H264" The value of the option to prefer the H264 video codec.


VIDEO_RESOLUTION

Attribute Type: {JSON}
readonly
  Defined in: source/constants.js:1166      Available since 0.5.6

Note that currently getUserMedia() method only configures the maximum resolution of the Stream due to browser interopability and support.
The list of video resolutions sets configured in the getUserMedia() method.

Keys:

  • QQVGA {JSON}

    Value { width: 160, height: 120 } The value of the option to configure QQVGA resolution. Aspect ratio: 4:3 Note that configurating this resolution may not be supported depending on browser and device supports.

  • HQVGA {JSON}

    Value { width: 240, height: 160 } The value of the option to configure HQVGA resolution. Aspect ratio: 3:2 Note that configurating this resolution may not be supported depending on browser and device supports.

  • QVGA {JSON}

    Value { width: 320, height: 240 } The value of the option to configure QVGA resolution. Aspect ratio: 4:3

  • WQVGA {JSON}

    Value { width: 384, height: 240 } The value of the option to configure WQVGA resolution. Aspect ratio: 16:10 Note that configurating this resolution may not be supported depending on browser and device supports.

  • HVGA {JSON}

    Value { width: 480, height: 320 } The value of the option to configure HVGA resolution. Aspect ratio: 3:2 Note that configurating this resolution may not be supported depending on browser and device supports.

  • VGA {JSON}

    Value { width: 640, height: 480 } The value of the option to configure VGA resolution. Aspect ratio: 4:3

  • WVGA {JSON}

    Value { width: 768, height: 480 } The value of the option to configure WVGA resolution. Aspect ratio: 16:10 Note that configurating this resolution may not be supported depending on browser and device supports.

  • FWVGA {JSON}

    Value { width: 854, height: 480 } The value of the option to configure FWVGA resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on browser and device supports.

  • SVGA {JSON}

    Value { width: 800, height: 600 } The value of the option to configure SVGA resolution. Aspect ratio: 4:3 Note that configurating this resolution may not be supported depending on browser and device supports.

  • DVGA {JSON}

    Value { width: 960, height: 640 } The value of the option to configure DVGA resolution. Aspect ratio: 3:2 Note that configurating this resolution may not be supported depending on browser and device supports.

  • WSVGA {JSON}

    Value { width: 1024, height: 576 } The value of the option to configure WSVGA resolution. Aspect ratio: 16:9

  • HD {JSON}

    Value { width: 1280, height: 720 } The value of the option to configure HD resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on device supports.

  • HDPLUS {JSON}

    Value { width: 1600, height: 900 } The value of the option to configure HDPLUS resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on browser and device supports.

  • FHD {JSON}

    Value { width: 1920, height: 1080 } The value of the option to configure FHD resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on device supports.

  • QHD {JSON}

    Value { width: 2560, height: 1440 } The value of the option to configure QHD resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on browser and device supports.

  • WQXGAPLUS {JSON}

    Value { width: 3200, height: 1800 } The value of the option to configure WQXGAPLUS resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on browser and device supports.

  • UHD {JSON}

    Value { width: 3840, height: 2160 } The value of the option to configure UHD resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on browser and device supports.

  • UHDPLUS {JSON}

    Value { width: 5120, height: 2880 } The value of the option to configure UHDPLUS resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on browser and device supports.

  • FUHD {JSON}

    Value { width: 7680, height: 4320 } The value of the option to configure FUHD resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on browser and device supports.

  • QUHD {JSON}

    Value { width: 15360, height: 8640 } The value of the option to configure QUHD resolution. Aspect ratio: 16:9 Note that configurating this resolution may not be supported depending on browser and device supports.


candidateGenerationState

  Defined in: source/skylink-events.js:120      Available since 0.1.0

Learn more about how ICE works in this article here.
Event triggered when a Peer connection ICE gathering state has changed.

Event Payload:

  • state {String}

    The current Peer connection ICE gathering state. [Rel: Skylink.CANDIDATE_GENERATION_STATE]

  • peerId {String}

    The Peer ID.


candidateProcessingState

  Defined in: source/skylink-events.js:1259      Available since 0.6.16

Learn more about how ICE works in this article here.
Note that this event may not be triggered for MCU enabled Peer connections as ICE candidates may be received in the session description instead.
Event triggered when remote ICE candidate processing state has changed when Peer is using trickle ICE.

Event Payload:

  • state {String}

    The ICE candidate processing state. [Rel: Skylink.CANDIDATE_PROCESSING_STATE]

  • peerId {String}

    The Peer ID.

  • candidateId {String}

    The remote ICE candidate session ID. Note that this value is not related to WebRTC API but for identification of remote ICE candidate received.

  • candidateType {String}

    The remote ICE candidate type. Expected values are "host" (local network), "srflx" (STUN) and "relay" (TURN).

  • candidate {JSON}

    The remote ICE candidate.

    • candidate {String}

      The remote ICE candidate connection description.

    • sdpMid {String}

      The remote ICE candidate identifier based on the remote session description.

    • sdpMLineIndex {Number}

      The remote ICE candidate media description index (starting from 0) based on the remote session description.

  • error {Error} Optional

    The error object. Defined only when state is DROPPED or PROCESS_ERROR.


candidatesGathered

  Defined in: source/skylink-events.js:1287      Available since 0.6.18

Learn more about how ICE works in this article here.
Note that this event may not be triggered for MCU enabled Peer connections as ICE candidates may be received in the session description instead.
Event triggered when all remote ICE candidates gathering has completed and been processed.

Event Payload:

  • peerId {String}

    The Peer ID.

  • length {JSON}

    The remote ICE candidates length.

    • expected {Number}

      The expected total number of remote ICE candidates to be received.

    • received {Number}

      The actual total number of remote ICE candidates received.

    • processed {Number}

      The total number of remote ICE candidates processed.


channelClose

  Defined in: source/skylink-events.js:17      Available since 0.1.0

Event triggered when socket connection to Signaling server has closed.

Event Payload:

  • session {JSON}

    The socket connection session information. Object signature matches the session parameter payload received in the channelOpen event.


channelError

  Defined in: source/skylink-events.js:43      Available since 0.1.0

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.
skylinkDemo.on("eventName", function () { // Errors here });
Event triggered when socket connection encountered exception.

Event Payload:

  • error {Error | String}

    The error object.

  • session {JSON}

    The socket connection session information. Object signature matches the session parameter payload received in the channelOpen event.


channelMessage

  Defined in: source/skylink-events.js:28      Available since 0.1.0

Note that this is used only for SDK developer purposes.
Event triggered when receiving socket message from the Signaling server.

Event Payload:

  • message {JSON}

    The socket message object.

  • session {JSON}

    The socket connection session information. Object signature matches the session parameter payload received in the channelOpen event.


channelOpen

  Defined in: source/skylink-events.js:2      Available since 0.1.0

Event triggered when socket connection to Signaling server has opened.

Event Payload:

  • session {JSON}

    The socket connection session information.

    • serverUrl {String}

      The socket connection Signaling url used.

    • transportType {String}

      The socket connection transport type used.

    • socketOptions {JSON}

      The socket connection options.

    • attempts {Number}

      The socket connection current reconnection attempts.

    • finalAttempts {Number}

      The socket connection current last attempts for the last available transports and port.


channelRetry

  Defined in: source/skylink-events.js:60      Available since 0.5.6

Event triggered when attempting to establish socket connection to Signaling server when failed.

Event Payload:

  • fallbackType {String}

    The current fallback state. [Rel: Skylink.SOCKET_FALLBACK]

  • currentAttempt {Number}

    The current socket reconnection attempt.

  • session {JSON}

    The socket connection session information. Object signature matches the session parameter payload received in the channelOpen event.


dataChannelState

  Defined in: source/skylink-events.js:568      Available since 0.1.0

Event triggered when a Datachannel connection state has changed.

Event Payload:

  • state {String}

    The current Datachannel connection state. [Rel: Skylink.DATA_CHANNEL_STATE]

  • peerId {String}

    The Peer ID.

  • error {Error} Optional

    The error object. Defined only when state payload is ERROR or SEND_MESSAGE_ERROR.

  • channelName {String}

    The Datachannel ID.

  • channelType {String}

    The Datachannel type. [Rel: Skylink.DATA_CHANNEL_TYPE]

  • messageType {String}

    The Datachannel sending Datachannel message error type. Defined only when state payload is SEND_MESSAGE_ERROR. [Rel: Skylink.DATA_CHANNEL_MESSAGE_ERROR]

  • bufferAmount {JSON}

    The Datachannel buffered amount information.

    • bufferedAmountLow {Number}

      The size of currently queued data to send on the Datachannel connection.

    • bufferedAmountLowThreshold {Number}

      The current buffered amount low threshold configured.


dataStreamState

beta
  Defined in: source/skylink-events.js:641      Available since 0.6.18

Event triggered when a data streaming state has changed.

Event Payload:

  • state {String}

    The current data streaming state. [Rel: Skylink.DATA_STREAM_STATE]

  • streamId {String}

    The data streaming session ID. Note that this is defined as null when state payload is START_ERROR.

  • peerId {String}

    The Peer ID. Note that this could be defined as null when state payload is START_ERROR and there is no Peers to start data streaming with.

  • streamInfo {JSON}

    The data streaming information.

    • chunk {Blob | String} Optional

      The data chunk received. Defined only when state payload is RECEIVED or SENT.

    • chunkSize {Number}

      The data streaming data chunk size received.

    • chunkType {String}

      The data streaming data chunk type received. The initial data chunks value may change depending on the currently received data chunk type or the agent supported sending type of data chunks. [Rel: Skylink.DATA_TRANSFER_DATA_TYPE]

    • isStringStream {String}

      The flag if data streaming data chunks are strings.

    • isPrivate {Boolean}

      The flag if data streaming is targeted or not, basing off the targetPeerId parameter being defined in startStreamingData() method.

    • senderPeerId {String}

      The sender Peer ID.

  • error {Error} Optional

    The error object. Defined only when state payload is ERROR or START_ERROR,.


dataTransferState

  Defined in: source/skylink-events.js:590      Available since 0.4.1

Event triggered when a data transfer state has changed.

Event Payload:

  • state {String}

    The current data transfer state. [Rel: Skylink.DATA_TRANSFER_STATE]

  • transferId {String}

    The data transfer ID. Note that this is defined as null when state payload is START_ERROR.

  • peerId {String}

    The Peer ID. Note that this could be defined as null when state payload is START_ERROR and there is no Peers to start data transfer with.

  • transferInfo {JSON}

    The data transfer information.

    • data {Blob | String} Optional

      The data object. Defined only when state payload is UPLOAD_STARTED or DOWNLOAD_COMPLETED.

    • name {String}

      The data transfer name.

    • size {Number}

      The data transfer data object size.

    • dataType {String}

      The data transfer session type. [Rel: Skylink.DATA_TRANSFER_SESSION_TYPE]

    • chunkType {String}

      The data transfer type of data chunk being used to send to Peer for transfers. For sendBlobData() method data transfers, the initial data chunks value may change depending on the currently received data chunk type or the agent supported sending type of data chunks. For sendURLData() method data transfers, it is STRING always. [Rel: Skylink.DATA_TRANSFER_DATA_TYPE]

    • mimeType {String} Optional

      The data transfer data object MIME type. Defined only when sendBlobData() method data object sent MIME type information is defined.

    • chunkSize {Number}

      The data transfer data chunk size.

    • percentage {Number}

      The data transfer percentage of completion progress.

    • timeout {Number}

      The flag if data transfer is targeted or not, basing off the targetPeerId parameter being defined in sendURLData() method or sendBlobData() method.

    • isPrivate {Boolean}

      The flag if message is targeted or not, basing off the targetPeerId parameter being defined in sendBlobData() method or sendURLData() method.

    • direction {String}

      The data transfer direction. [Rel: Skylink.DATA_TRANSFER_TYPE]

  • error {JSON} Optional

    The error result. Defined only when state payload is ERROR, CANCEL, REJECTED, START_ERROR or USER_REJECTED.

    • message {Error | String}

      The error object.

    • transferType {String}

      The data transfer direction from where the error occurred. [Rel: Skylink.DATA_TRANSFER_TYPE]


getConnectionStatusStateChange

  Defined in: source/skylink-events.js:799      Available since 0.6.14

Event triggered when getConnectionStatus() method retrieval state changes.

Event Payload:

  • state {Number}

    The current getConnectionStatus() retrieval state. [Rel: Skylink.GET_CONNECTION_STATUS_STATE]

  • peerId {String}

    The Peer ID.

  • stats {JSON} Optional

    The Peer connection current stats. Defined only when state payload is RETRIEVE_SUCCESS.

    • raw {JSON}

      The Peer connection raw stats before parsing.

    • audio {JSON}

      The Peer connection audio streaming stats.

      • sending {JSON}
        The Peer connection sending audio streaming stats.
      • sending.bytes {Number}
        The Peer connection current sending audio streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps.
      • sending.totalBytes {Number}
        The Peer connection total sending audio streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps.
      • sending.packets {Number}
        The Peer connection current sending audio streaming packets.
      • sending.totalPackets {Number}
        The Peer connection total sending audio streaming packets.
      • sending.packetsLost {Number}
        This property has been deprecated and would be removed in future releases as it should not be in sending property.
        The Peer connection current sending audio streaming packets lost.
      • sending.totalPacketsLost {Number}
        This property has been deprecated and would be removed in future releases as it should not be in sending property.
        The Peer connection total sending audio streaming packets lost.
      • sending.ssrc {Number}
        The Peer connection sending audio streaming RTP packets SSRC.
      • sending.rtt {Number}
        The Peer connection sending audio streaming RTT (Round-trip delay time). Defined as 0 if it's not present in original raw stats before parsing.
      • sending.jitter {Number}
        This property has been deprecated and would be removed in future releases as it should not be in sending property.
        The Peer connection sending audio streaming RTP packets jitter in seconds. Defined as 0 if it's not present in original raw stats before parsing.
      • sending.jitterBufferMs {Number} Optional
        This property has been deprecated and would be removed in future releases as it should not be in sending property.
        The Peer connection sending audio streaming RTP packets jitter buffer in miliseconds. Defined as null if it's not available in original raw stats before parsing.
      • sending.codec {JSON} Optional
        The Peer connection sending audio streaming selected codec information. Defined as null if local session description is not available before parsing.
      • sending.codec.name {String}
        The Peer connection sending audio streaming selected codec name.
      • sending.codec.payloadType {Number}
        The Peer connection sending audio streaming selected codec payload type.
      • sending.codec.implementation {String} Optional
        The Peer connection sending audio streaming selected codec implementation. Defined as null if it's not available in original raw stats before parsing.
      • sending.codec.channels {Number} Optional
        The Peer connection sending audio streaming selected codec channels (2 for stereo). Defined as null if it's not available in original raw stats before parsing, and this is usually present in stats.audio property.
      • sending.codec.clockRate {Number} Optional
        The Peer connection sending audio streaming selected codec media sampling rate. Defined as null if it's not available in original raw stats before parsing.
      • sending.codec.params {String} Optional
        The Peer connection sending audio streaming selected codec parameters. Defined as null if it's not available in original raw stats before parsing.
      • sending.inputLevel {Number} Optional
        The Peer connection sending audio streaming input level. Defined as null if it's not available in original raw stats before parsing.
      • sending.echoReturnLoss {Number} Optional
        The Peer connection sending audio streaming echo return loss in db (decibels). Defined as null if it's not available in original raw stats before parsing.
      • sending.echoReturnLossEnhancement {Number} Optional
        The Peer connection sending audio streaming echo return loss enhancement db (decibels). Defined as null if it's not available in original raw stats before parsing.
      • receiving {JSON}
        The Peer connection receiving audio streaming stats.
      • receiving.bytes {Number}
        The Peer connection current sending audio streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps.
      • receiving.totalBytes {Number}
        The Peer connection total sending audio streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps.
      • receiving.packets {Number}
        The Peer connection current receiving audio streaming packets.
      • receiving.totalPackets {Number}
        The Peer connection total receiving audio streaming packets.
      • receiving.packetsLost {Number}
        The Peer connection current receiving audio streaming packets lost.
      • receiving.fractionLost {Number}
        The Peer connection current receiving audio streaming fraction packets lost.
      • receiving.packetsDiscarded {Number}
        The Peer connection current receiving audio streaming packets discarded.
      • receiving.totalPacketsLost {Number}
        The Peer connection total receiving audio streaming packets lost.
      • receiving.totalPacketsDiscarded {Number}
        The Peer connection total receiving audio streaming packets discarded.
      • receiving.ssrc {Number}
        The Peer connection receiving audio streaming RTP packets SSRC.
      • receiving.jitter {Number}
        The Peer connection receiving audio streaming RTP packets jitter in seconds. Defined as 0 if it's not present in original raw stats before parsing.
      • receiving.jitterBufferMs {Number} Optional
        The Peer connection receiving audio streaming RTP packets jitter buffer in miliseconds. Defined as null if it's not available in original raw stats before parsing.
      • receiving.codec {JSON} Optional
        The Peer connection receiving audio streaming selected codec information. Defined as null if remote session description is not available before parsing. Note that if the value is polyfilled, the value may not be accurate since the remote Peer can override the selected codec. The value is derived from the remote session description.
      • receiving.codec.name {String}
        The Peer connection receiving audio streaming selected codec name.
      • receiving.codec.payloadType {Number}
        The Peer connection receiving audio streaming selected codec payload type.
      • receiving.codec.implementation {String} Optional
        The Peer connection receiving audio streaming selected codec implementation. Defined as null if it's not available in original raw stats before parsing.
      • receiving.codec.channels {Number} Optional
        The Peer connection receiving audio streaming selected codec channels (2 for stereo). Defined as null if it's not available in original raw stats before parsing, and this is usually present in stats.audio property.
      • receiving.codec.clockRate {Number} Optional
        The Peer connection receiving audio streaming selected codec media sampling rate. Defined as null if it's not available in original raw stats before parsing.
      • receiving.codec.params {String} Optional
        The Peer connection receiving audio streaming selected codec parameters. Defined as null if it's not available in original raw stats before parsing.
      • receiving.outputLevel {Number} Optional
        The Peer connection receiving audio streaming output level. Defined as null if it's not available in original raw stats before parsing.
    • video {JSON}

      The Peer connection video streaming stats.

      • sending {JSON}
        The Peer connection sending video streaming stats.
      • sending.bytes {Number}
        The Peer connection current sending video streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps.
      • sending.totalBytes {Number}
        The Peer connection total sending video streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps.
      • sending.packets {Number}
        The Peer connection current sending video streaming packets.
      • sending.totalPackets {Number}
        The Peer connection total sending video streaming packets.
      • sending.packetsLost {Number}
        This property has been deprecated and would be removed in future releases as it should not be in sending property.
        The Peer connection current sending video streaming packets lost.
      • sending.totalPacketsLost {Number}
        This property has been deprecated and would be removed in future releases as it should not be in sending property.
        The Peer connection total sending video streaming packets lost.
      • sending.ssrc {Number}
        The Peer connection sending video streaming RTP packets SSRC.
      • sending.rtt {Number}
        The Peer connection sending video streaming RTT (Round-trip delay time). Defined as 0 if it's not present in original raw stats before parsing.
      • sending.jitter {Number}
        This property has been deprecated and would be removed in future releases as it should not be in sending property.
        The Peer connection sending video streaming RTP packets jitter in seconds. Defined as 0 if it's not present in original raw stats before parsing.
      • sending.jitterBufferMs {Number} Optional
        This property has been deprecated and would be removed in future releases as it should not be in sending property.
        The Peer connection sending video streaming RTP packets jitter buffer in miliseconds. Defined as null if it's not available in original raw stats before parsing.
      • sending.qpSum {Number} Optional
        The Peer connection sending video streaming sum of the QP values of frames passed. Defined as null if it's not available in original raw stats before parsing.
      • sending.codec {JSON} Optional
        The Peer connection sending video streaming selected codec information. Defined as null if local session description is not available before parsing.
      • sending.codec.name {String}
        The Peer connection sending video streaming selected codec name.
      • sending.codec.payloadType {Number}
        The Peer connection sending video streaming selected codec payload type.
      • sending.codec.implementation {String} Optional
        The Peer connection sending video streaming selected codec implementation. Defined as null if it's not available in original raw stats before parsing.
      • sending.codec.channels {Number} Optional
        The Peer connection sending video streaming selected codec channels (2 for stereo). Defined as null if it's not available in original raw stats before parsing, and this is usually present in stats.audio property.
      • sending.codec.clockRate {Number} Optional
        The Peer connection sending video streaming selected codec media sampling rate. Defined as null if it's not available in original raw stats before parsing.
      • sending.codec.params {String} Optional
        The Peer connection sending video streaming selected codec parameters. Defined as null if it's not available in original raw stats before parsing.
      • sending.frames {Number} Optional
        The Peer connection sending video streaming frames. Defined as null if it's not available in original raw stats before parsing.
      • sending.frameRateInput {Number} Optional
        The Peer connection sending video streaming fps input. Defined as null if it's not available in original raw stats before parsing.
      • sending.frameRateInput {Number} Optional
        The Peer connection sending video streaming fps input. Defined as null if it's not available in original raw stats before parsing.
      • sending.framesDropped {Number} Optional
        The Peer connection sending video streaming frames dropped. Defined as null if it's not available in original raw stats before parsing.
      • sending.frameRateMean {Number} Optional
        The Peer connection sending video streaming fps mean. Defined as null if it's not available in original raw stats before parsing.
      • sending.frameRateStdDev {Number} Optional
        The Peer connection sending video streaming fps standard deviation. Defined as null if it's not available in original raw stats before parsing.
      • sending.framesPerSecond {Number} Optional
        The Peer connection sending video streaming fps. Defined as null if it's not available in original raw stats before parsing.
      • sending.framesDecoded {Number} Optional
        The Peer connection sending video streaming frames decoded. Defined as null if it's not available in original raw stats before parsing.
      • sending.framesCorrupted {Number} Optional
        The Peer connection sending video streaming frames corrupted. Defined as null if it's not available in original raw stats before parsing.
      • sending.totalFrames {Number} Optional
        The Peer connection total sending video streaming frames. Defined as null if it's not available in original raw stats before parsing.
      • sending.nacks {Number} Optional
        The Peer connection current sending video streaming nacks. Defined as null if it's not available in original raw stats before parsing.
      • sending.totalNacks {Number} Optional
        The Peer connection total sending video streaming nacks. Defined as null if it's not available in original raw stats before parsing.
      • sending.plis {Number} Optional
        The Peer connection current sending video streaming plis. Defined as null if it's not available in original raw stats before parsing.
      • sending.totalPlis {Number} Optional
        The Peer connection total sending video streaming plis. Defined as null if it's not available in original raw stats before parsing.
      • sending.firs {Number} Optional
        The Peer connection current sending video streaming firs. Defined as null if it's not available in original raw stats before parsing.
      • sending.totalFirs {Number} Optional
        The Peer connection total sending video streaming firs. Defined as null if it's not available in original raw stats before parsing.
      • sending.slis {Number} Optional
        The Peer connection current sending video streaming slis. Defined as null if it's not available in original raw stats before parsing.
      • sending.totalSlis {Number} Optional
        The Peer connection total sending video streaming slis. Defined as null if it's not available in original raw stats before parsing.
      • receiving {JSON}
        The Peer connection receiving video streaming stats.
      • receiving.bytes {Number}
        The Peer connection current receiving video streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps.
      • receiving.totalBytes {Number}
        The Peer connection total receiving video streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps.
      • receiving.packets {Number}
        The Peer connection current receiving video streaming packets.
      • receiving.totalPackets {Number}
        The Peer connection total receiving video streaming packets.
      • receiving.packetsLost {Number}
        The Peer connection current receiving video streaming packets lost.
      • receiving.fractionLost {Number}
        The Peer connection current receiving video streaming fraction packets lost.
      • receiving.packetsDiscarded {Number}
        The Peer connection current receiving video streaming packets discarded.
      • receiving.totalPacketsLost {Number}
        The Peer connection total receiving video streaming packets lost.
      • receiving.totalPacketsDiscarded {Number}
        The Peer connection total receiving video streaming packets discarded.
      • receiving.ssrc {Number}
        The Peer connection receiving video streaming RTP packets SSRC.
      • receiving.e2eDelay {Number} Optional
        The Peer connection receiving video streaming e2e delay. Defined as null if it's not present in original raw stats before parsing, and that it finds any existing audio, video or object (plugin) DOM elements that has set with the Peer remote stream object to parse current time. Note that document.getElementsByTagName function and DOM .currentTime has to be supported inorder for data to be parsed correctly.
      • receiving.jitter {Number}
        The Peer connection receiving video streaming RTP packets jitter in seconds. Defined as 0 if it's not present in original raw stats before parsing.
      • receiving.jitterBufferMs {Number} Optional
        The Peer connection receiving video streaming RTP packets jitter buffer in miliseconds. Defined as null if it's not available in original raw stats before parsing.
      • receiving.codec {JSON} Optional
        The Peer connection receiving video streaming selected codec information. Defined as null if remote session description is not available before parsing. Note that if the value is polyfilled, the value may not be accurate since the remote Peer can override the selected codec. The value is derived from the remote session description.
      • receiving.codec.name {String}
        The Peer connection receiving video streaming selected codec name.
      • receiving.codec.payloadType {Number}
        The Peer connection receiving video streaming selected codec payload type.
      • receiving.codec.implementation {String} Optional
        The Peer connection receiving video streaming selected codec implementation. Defined as null if it's not available in original raw stats before parsing.
      • receiving.codec.channels {Number} Optional
        The Peer connection receiving video streaming selected codec channels (2 for stereo). Defined as null if it's not available in original raw stats before parsing, and this is usually present in stats.audio property.
      • receiving.codec.clockRate {Number} Optional
        The Peer connection receiving video streaming selected codec media sampling rate. Defined as null if it's not available in original raw stats before parsing.
      • receiving.codec.params {String} Optional
        The Peer connection receiving video streaming selected codec parameters. Defined as null if it's not available in original raw stats before parsing.
      • receiving.frames {Number} Optional
        The Peer connection receiving video streaming frames. Defined as null if it's not available in original raw stats before parsing.
      • receiving.framesOutput {Number} Optional
        The Peer connection receiving video streaming fps output. Defined as null if it's not available in original raw stats before parsing.
      • receiving.framesDecoded {Number} Optional
        The Peer connection receiving video streaming frames decoded. Defined as null if it's not available in original raw stats before parsing.
      • receiving.frameRateMean {Number} Optional
        The Peer connection receiving video streaming fps mean. Defined as null if it's not available in original raw stats before parsing.
      • receiving.frameRateStdDev {Number} Optional
        The Peer connection receiving video streaming fps standard deviation. Defined as null if it's not available in original raw stats before parsing.
      • receiving.framesPerSecond {Number} Optional
        The Peer connection receiving video streaming fps. Defined as null if it's not available in original raw stats before parsing.
      • receiving.framesDecoded {Number} Optional
        The Peer connection receiving video streaming frames decoded. Defined as null if it's not available in original raw stats before parsing.
      • receiving.framesCorrupted {Number} Optional
        The Peer connection receiving video streaming frames corrupted. Defined as null if it's not available in original raw stats before parsing.
      • receiving.totalFrames {Number} Optional
        The Peer connection total receiving video streaming frames. Defined as null if it's not available in original raw stats before parsing.
      • receiving.nacks {Number} Optional
        The Peer connection current receiving video streaming nacks. Defined as null if it's not available in original raw stats before parsing.
      • receiving.totalNacks {Number} Optional
        The Peer connection total receiving video streaming nacks. Defined as null if it's not available in original raw stats before parsing.
      • receiving.plis {Number} Optional
        The Peer connection current receiving video streaming plis. Defined as null if it's not available in original raw stats before parsing.
      • receiving.totalPlis {Number} Optional
        The Peer connection total receiving video streaming plis. Defined as null if it's not available in original raw stats before parsing.
      • receiving.firs {Number} Optional
        The Peer connection current receiving video streaming firs. Defined as null if it's not available in original raw stats before parsing.
      • receiving.totalFirs {Number} Optional
        The Peer connection total receiving video streaming firs. Defined as null if it's not available in original raw stats before parsing.
      • receiving.slis {Number} Optional
        The Peer connection current receiving video streaming slis. Defined as null if it's not available in original raw stats before parsing.
      • receiving.totalPlis {Number} Optional
        The Peer connection total receiving video streaming slis. Defined as null if it's not available in original raw stats before parsing.
    • selectedCandidate {JSON}

      The Peer connection selected ICE candidate pair stats.

      • local {JSON}
        The Peer connection selected local ICE candidate.
      • local.ipAddress {String}
        The Peer connection selected local ICE candidate IP address.
      • local.portNumber {Number}
        The Peer connection selected local ICE candidate port number.
      • local.transport {String}
        The Peer connection selected local ICE candidate IP transport type.
      • local.candidateType {String}
        The Peer connection selected local ICE candidate type.
      • local.turnMediaTransport {String} Optional
        The Peer connection possible transport used when relaying local media to TURN server. Types are "UDP" (UDP connections), "TCP" (TCP connections) and "TCP/TLS" (TCP over TLS connections).
      • remote {JSON}
        The Peer connection selected remote ICE candidate.
      • remote.ipAddress {String}
        The Peer connection selected remote ICE candidate IP address.
      • remote.portNumber {Number}
        The Peer connection selected remote ICE candidate port number.
      • remote.transport {String}
        The Peer connection selected remote ICE candidate IP transport type.
      • remote.candidateType {String}
        The Peer connection selected remote ICE candidate type.
      • writable {Boolean} Optional
        The flag if Peer has gotten ACK to an ICE request. Defined as null if it's not available in original raw stats before parsing.
      • readable {Boolean} Optional
        The flag if Peer has gotten a valid incoming ICE request. Defined as null if it's not available in original raw stats before parsing.
      • rtt {String} Optional
        The current STUN connectivity checks RTT (Round-trip delay time). Defined as null if it's not available in original raw stats before parsing.
      • totalRtt {String} Optional
        The total STUN connectivity checks RTT (Round-trip delay time). Defined as null if it's not available in original raw stats before parsing.
      • requests {JSON}
        The ICE connectivity check requests.
      • requests.received {String} Optional
        The current ICE connectivity check requests received. Defined as null if it's not available in original raw stats before parsing.
      • requests.sent {String} Optional
        The current ICE connectivity check requests sent. Defined as null if it's not available in original raw stats before parsing.
      • requests.totalReceived {String} Optional
        The total ICE connectivity check requests received. Defined as null if it's not available in original raw stats before parsing.
      • requests.totalSent {String} Optional
        The total ICE connectivity check requests sent. Defined as null if it's not available in original raw stats before parsing.
      • responses {JSON}
        The ICE connectivity check responses.
      • responses.received {String} Optional
        The current ICE connectivity check responses received. Defined as null if it's not available in original raw stats before parsing.
      • responses.sent {String} Optional
        The current ICE connectivity check responses sent. Defined as null if it's not available in original raw stats before parsing.
      • responses.totalReceived {String} Optional
        The total ICE connectivity check responses received. Defined as null if it's not available in original raw stats before parsing.
      • responses.totalSent {String} Optional
        The total ICE connectivity check responses sent. Defined as null if it's not available in original raw stats before parsing.
      • consentRequests {JSON}
        The current ICE consent requests.
      • consentRequests.received {String} Optional
        The current ICE consent requests received. Defined as null if it's not available in original raw stats before parsing.
      • consentRequests.sent {String} Optional
        The current ICE consent requests sent. Defined as null if it's not available in original raw stats before parsing.
      • consentRequests.totalReceived {String} Optional
        The total ICE consent requests received. Defined as null if it's not available in original raw stats before parsing.
      • consentRequests.totalSent {String} Optional
        The total ICE consent requests sent. Defined as null if it's not available in original raw stats before parsing.
      • consentResponses {JSON}
        The current ICE consent responses.
      • consentResponses.received {String} Optional
        The current ICE consent responses received. Defined as null if it's not available in original raw stats before parsing.
      • consentResponses.sent {String} Optional
        The current ICE consent responses sent. Defined as null if it's not available in original raw stats before parsing.
      • consentResponses.totalReceived {String} Optional
        The total ICE consent responses received. Defined as null if it's not available in original raw stats before parsing.
      • consentResponses.totalSent {String} Optional
        The total ICE consent responses sent. Defined as null if it's not available in original raw stats before parsing.
    • certificate {JSON}

      The Peer connection DTLS/SRTP exchanged certificates information.

      • local {JSON}
        The Peer connection local certificate information.
      • local.fingerprint {String} Optional
        The Peer connection local certificate fingerprint. Defined as null if it's not available in original raw stats before parsing.
      • local.fingerprintAlgorithm {String} Optional
        The Peer connection local certificate fingerprint algorithm. Defined as null if it's not available in original raw stats before parsing.
      • local.derBase64 {String} Optional
        The Peer connection local base64 certificate in binary DER format encoded in base64. Defined as null if it's not available in original raw stats before parsing.
      • remote {JSON}
        The Peer connection remote certificate information.
      • remote.fingerprint {String} Optional
        The Peer connection remote certificate fingerprint. Defined as null if it's not available in original raw stats before parsing.
      • remote.fingerprintAlgorithm {String} Optional
        The Peer connection remote certificate fingerprint algorithm. Defined as null if it's not available in original raw stats before parsing.
      • remote.derBase64 {String} Optional
        The Peer connection remote base64 certificate in binary DER format encoded in base64. Defined as null if it's not available in original raw stats before parsing.
      • srtpCipher {String} Optional
        The certificates SRTP cipher. Defined as null if it's not available in original raw stats before parsing.
      • dtlsCipher {String} Optional
        The certificates DTLS cipher. Defined as null if it's not available in original raw stats before parsing.
    • connection {JSON}

      The Peer connection object stats.

      • iceConnectionState {String}
        The Peer connection ICE connection state.
      • iceGatheringState {String}
        The Peer connection ICE gathering state.
      • signalingState {String}
        The Peer connection signaling state.
      • localDescription {JSON}
        The Peer connection local session description.
      • localDescription.type {String}
        The Peer connection local session description type. Defined as null when local session description is not available.
      • localDescription.sdp {String}
        The Peer connection local session description SDP. Defined as null when local session description is not available.
      • remoteDescription {JSON}
        The Peer connection remote session description.
      • remoteDescription.type {String}
        The Peer connection remote session description type. Defined as null when remote session description is not available.
      • remoteDescription.sdp {String}
        The Peer connection remote session description sdp. Defined as null when remote session description is not available.
      • candidates {JSON}
        The Peer connection list of ICE candidates sent or received.
      • candidates.sending {JSON}
        The Peer connection list of local ICE candidates sent.
      • candidates.sending.host {Array}
        The Peer connection list of local "host" (local network) ICE candidates sent.
      • candidates.sending.host.#index {JSON}
        The Peer connection local "host" (local network) ICE candidate.
      • candidates.sending.host.#index.candidate {String}
        The Peer connection local "host" (local network) ICE candidate connection description.
      • candidates.sending.host.#index.sdpMid {String}
        The Peer connection local "host" (local network) ICE candidate identifier based on the local session description.
      • candidates.sending.host.#index.sdpMLineIndex {Number}
        The Peer connection local "host" (local network) ICE candidate media description index (starting from 0) based on the local session description.
      • candidates.sending.srflx {Array}
        The Peer connection list of local "srflx" (STUN) ICE candidates sent.
      • candidates.sending.srflx.#index {JSON}
        The Peer connection local "srflx" (STUN) ICE candidate.
      • candidates.sending.srflx.#index.candidate {String}
        The Peer connection local "srflx" (STUN) ICE candidate connection description.
      • candidates.sending.srflx.#index.sdpMid {String}
        The Peer connection local "srflx" (STUN) ICE candidate identifier based on the local session description.
      • candidates.sending.srflx.#index.sdpMLineIndex {Number}
        The Peer connection local "srflx" (STUN) ICE candidate media description index (starting from 0) based on the local session description.
      • candidates.sending.relay {Array}
        The Peer connection list of local "relay" (TURN) candidates sent.
      • candidates.sending.relay.#index {JSON}
        The Peer connection local "relay" (TURN) ICE candidate.
      • candidates.sending.relay.#index.candidate {String}
        The Peer connection local "relay" (TURN) ICE candidate connection description.
      • candidates.sending.relay.#index.sdpMid {String}
        The Peer connection local "relay" (TURN) ICE candidate identifier based on the local session description.
      • candidates.sending.relay.#index.sdpMLineIndex {Number}
        The Peer connection local "relay" (TURN) ICE candidate media description index (starting from 0) based on the local session description.
      • candidates.receiving {JSON}
        The Peer connection list of remote ICE candidates received.
      • candidates.receiving.host {Array}
        The Peer connection list of remote "host" (local network) ICE candidates received.
      • candidates.receiving.host.#index {JSON}
        The Peer connection remote "host" (local network) ICE candidate.
      • candidates.receiving.host.#index.candidate {String}
        The Peer connection remote "host" (local network) ICE candidate connection description.
      • candidates.receiving.host.#index.sdpMid {String}
        The Peer connection remote "host" (local network) ICE candidate identifier based on the remote session description.
      • candidates.receiving.host.#index.sdpMLineIndex {Number}
        The Peer connection remote "host" (local network) ICE candidate media description index (starting from 0) based on the remote session description.
      • candidates.receiving.srflx {Array}
        The Peer connection list of remote "srflx" (STUN) ICE candidates received.
      • candidates.receiving.srflx.#index {JSON}
        The Peer connection remote "srflx" (STUN) ICE candidate.
      • candidates.receiving.srflx.#index.candidate {String}
        The Peer connection remote "srflx" (STUN) ICE candidate connection description.
      • candidates.receiving.srflx.#index.sdpMid {String}
        The Peer connection remote "srflx" (STUN) ICE candidate identifier based on the remote session description.
      • candidates.receiving.srflx.#index.sdpMLineIndex {Number}
        The Peer connection remote "srflx" (STUN) ICE candidate media description index (starting from 0) based on the remote session description.
      • candidates.receiving.relay {Array}
        The Peer connection list of remote "relay" (TURN) ICE candidates received.
      • candidates.receiving.relay.#index {JSON}
        The Peer connection remote "relay" (TURN) ICE candidate.
      • candidates.receiving.relay.#index.candidate {String}
        The Peer connection remote "relay" (TURN) ICE candidate connection description.
      • candidates.receiving.relay.#index.sdpMid {String}
        The Peer connection remote "relay" (TURN) ICE candidate identifier based on the remote session description.
      • candidates.receiving.relay.#index.sdpMLineIndex {Number}
        The Peer connection remote "relay" (TURN) ICE candidate media description index (starting from 0) based on the remote session description.
      • dataChannels {JSON}
        The Peer connection list of Datachannel connections.
      • dataChannels.#channelName {JSON}
        The Peer connection Datachannel connection stats.
      • dataChannels.#channelName.label {String}
        The Peer connection Datachannel connection ID.
      • dataChannels.#channelName.readyState {String}
        The Peer connection Datachannel connection readyState. [Rel: Skylink.DATA_CHANNEL_STATE]
      • dataChannels.#channelName.type {String}
        The Peer connection Datachannel connection type. [Rel: Skylink.DATA_CHANNEL_TYPE]
      • dataChannels.#channelName.currentTransferId {String}
        The Peer connection Datachannel connection current progressing transfer session ID. Defined as null when there is currently no transfer session progressing on the Datachannel connection.
      • dataChannels.#channelName.currentStreamId {String}
        The Peer connection Datachannel connection current data streaming session ID. Defined as null when there is currently no data streaming session on the Datachannel connection.
      • constraints {JSON}
        The constraints passed in when constructing the Peer connection object.
      • optional {JSON}
        The optional constraints passed in when constructing the Peer connection object.
      • sdpConstraints {JSON} Optional
        The constraints passed in when creating Peer connection offer or answer.
  • error {Error}

    The error object received. Defined only when state payload is RETRIEVE_ERROR.


getPeersStateChange

  Defined in: source/skylink-events.js:749      Available since 0.6.1

Event triggered when getPeers() method retrieval state changes.

Event Payload:

  • state {String}

    The current getPeers() retrieval state. [Rel: Skylink.GET_PEERS_STATE]

  • privilegedPeerId {String}

    The User's privileged Peer ID.

  • peerList {JSON}

    The list of Peer IDs Rooms within the same App space.

    • #room {Array}

      The list of Peer IDs associated with the Room defined in #room property.


handshakeProgress

  Defined in: source/skylink-events.js:107      Available since 0.3.0

Event triggered when a Peer connection establishment state has changed.

Event Payload:

  • state {String}

    The current Peer connection establishment state. [Rel: Skylink.HANDSHAKE_PROGRESS]

  • peerId {String}

    The Peer ID.

  • error {Error | String} Optional

    The error object. Defined only when state is ERROR.


iceConnectionState

  Defined in: source/skylink-events.js:150      Available since 0.1.0

Learn more about how ICE works in this article here.
Event triggered when a Peer connection ICE connection state has changed.

Event Payload:

  • state {String}

    The current Peer connection ICE connection state. [Rel: Skylink.ICE_CONNECTION_STATE]

  • peerId {String}

    The Peer ID.


incomingData

  Defined in: source/skylink-events.js:474      Available since 0.6.1

Event triggered when receiving completed data transfer from Peer.

Event Payload:

  • data {Blob | String}

    The data.

  • transferId {String}

    The data transfer ID.

  • peerId {String}

    The Peer ID.

  • transferInfo {JSON}

    The data transfer information. Object signature matches the transferInfo parameter payload received in the dataTransferState event except without the data property.

  • isSelf {Boolean}

    The flag if Peer is User.


incomingDataRequest

  Defined in: source/skylink-events.js:490      Available since 0.6.1

Event triggered when receiving upload data transfer from Peer.

Event Payload:

  • transferId {String}

    The transfer ID.

  • peerId {String}

    The Peer ID.

  • transferInfo {String}

    The data transfer information. Object signature matches the transferInfo parameter payload received in the dataTransferState event except without the data property.

  • isSelf {Boolean}

    The flag if Peer is User.


incomingDataStream

beta
  Defined in: source/skylink-events.js:537      Available since 0.6.18

Event triggered when data streaming session has been stopped from Peer to User.

Event Payload:

  • chunk {Blob | String}

    The data chunk received.

  • streamId {String}

    The data streaming session ID.

  • peerId {String}

    The Peer ID.

  • streamInfo {JSON}

    The data streaming session information. Object signature matches the streamInfo parameter payload received in the dataStreamState event except without the chunk property.

  • isSelf {Boolean}

    The flag if Peer is User.


incomingDataStreamStarted

beta
  Defined in: source/skylink-events.js:505      Available since 0.6.18

Event triggered when data streaming session has been started from Peer to User.

Event Payload:

  • streamId {String}

    The data streaming session ID.

  • peerId {String}

    The Peer ID.

  • streamInfo {JSON}

    The data streaming session information. Object signature matches the streamInfo parameter payload received in the dataStreamState event except without the chunk property.

  • isSelf {Boolean}

    The flag if Peer is User.


incomingDataStreamStopped

beta
  Defined in: source/skylink-events.js:521      Available since 0.6.18

Event triggered when data streaming session has been stopped from Peer to User.

Event Payload:

  • streamId {String}

    The data streaming session ID.

  • peerId {String}

    The Peer ID.

  • streamInfo {JSON}

    The data streaming session information. Object signature matches the streamInfo parameter payload received in the dataStreamState event except without the chunk property.

  • isSelf {Boolean}

    The flag if Peer is User.


incomingMessage

  Defined in: source/skylink-events.js:443      Available since 0.5.2

Event triggered when receiving message from Peer.

Event Payload:

  • message {JSON}

    The message result.

    • content {JSON | String}

      The message object.

    • senderPeerId {String}

      The sender Peer ID.

    • targetPeerId {String | Array} Optional

      The value of the targetPeerId defined in sendP2PMessage() method or sendMessage() method. Defined as User's Peer ID when isSelf payload value is false. Defined as null when provided targetPeerId in sendP2PMessage() method or sendMessage() method is not defined.

    • listOfPeers {Array} Optional

      The list of Peers that the message has been sent to. Defined only when isSelf payload value is true.

    • isPrivate {Boolean}

      The flag if message is targeted or not, basing off the targetPeerId parameter being defined in sendP2PMessage() method or sendMessage() method.

    • isDataChannel {Boolean}

      The flag if message is sent from sendP2PMessage() method.

  • peerId {String}

    The Peer ID.

  • peerInfo {JSON}

    The Peer session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.

  • isSelf {Boolean}

    The flag if Peer is User.


incomingStream

  Defined in: source/skylink-events.js:426      Available since 0.5.5

Event triggered when receiving Peer Stream.

Event Payload:

  • peerId {String}

    The Peer ID.

  • stream {MediaStream}

    The Stream object. To attach it to an element: attachMediaStream(videoElement, stream);.

  • isSelf {Boolean}

    The flag if Peer is User.

  • peerInfo {JSON}

    The Peer session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.

  • isScreensharing {Boolean}

    The flag if Peer Stream is a screensharing Stream.

  • streamId {String}

    The Stream ID.


introduceStateChange

  Defined in: source/skylink-events.js:762      Available since 0.6.1

Event triggered when introducePeer() method introduction request state changes.

Event Payload:

  • state {String}

    The current introducePeer() introduction request state. [Rel: Skylink.INTRODUCE_STATE]

  • privilegedPeerId {String}

    The User's privileged Peer ID.

  • sendingPeerId {String}

    The Peer ID to be connected with receivingPeerId.

  • receivingPeerId {String}

    The Peer ID to be connected with sendingPeerId.

  • reason {String} Optional

    The error object. Defined only when state payload is ERROR.


localMediaMuted

  Defined in: source/skylink-events.js:1242      Available since 0.6.15

Event triggered when muteStream() method changes User Streams audio and video tracks muted status.

Event Payload:

  • mediaStatus {JSON}

    The Streams muted settings. This indicates the muted settings for both getUserMedia() Stream and shareScreen() Stream.

    • audioMuted {Boolean}

      The flag if all Streams audio tracks is muted or not. If User's peerInfo.settings.audio is false, this will be defined as true.

    • videoMuted {Boolean}

      The flag if all Streams video tracks is muted or not. If User's peerInfo.settings.video is false, this will be defined as true.


mediaAccessError

  Defined in: source/skylink-events.js:165      Available since 0.1.0

Event triggered when retrieval of Stream failed.

Event Payload:

  • error {Error | String}

    The error object.

  • isScreensharing {Boolean}

    The flag if event occurred during shareScreen() method and not getUserMedia() method.

  • isAudioFallbackError {Boolean}

    The flag if event occurred during retrieval of audio tracks only when getUserMedia() method had failed to retrieve both audio and video tracks.


mediaAccessFallback

  Defined in: source/skylink-events.js:180      Available since 0.6.3

Event triggered when Stream retrieval fallback state has changed.

Event Payload:

  • error {JSON}

    The error result.

    • error {Error | String}

      The error object.

    • diff {JSON} Optional

      The list of excepted but received audio and video tracks in Stream. Defined only when state payload is FALLBACKED.

      • video {JSON}
        The expected and received video tracks.
      • video.expected {Number}
        The expected video tracks.
      • video.received {Number}
        The received video tracks.
      • audio {JSON}
        The expected and received audio tracks.
      • audio.expected {Number}
        The expected audio tracks.
      • audio.received {Number}
        The received audio tracks.
  • state {Number}

    The fallback state. [Rel: Skylink.MEDIA_ACCESS_FALLBACK_STATE]

  • isScreensharing {Boolean}

    The flag if event occurred during shareScreen() method and not getUserMedia() method.

  • isAudioFallback {Boolean}

    The flag if event occurred during retrieval of audio tracks only when getUserMedia() method had failed to retrieve both audio and video tracks.

  • streamId {String}

    The Stream ID. Defined only when state payload is FALLBACKED.


mediaAccessRequired

  Defined in: source/skylink-events.js:225      Available since 0.5.5

Event triggered when retrieval of Stream is required to complete joinRoom() method request.


mediaAccessStopped

  Defined in: source/skylink-events.js:234      Available since 0.5.6

Event triggered when Stream has stopped streaming.

Event Payload:

  • isScreensharing {Boolean}

    The flag if event occurred during shareScreen() method and not getUserMedia() method.

  • isAudioFallback {Boolean}

    The flag if event occurred during retrieval of audio tracks only when getUserMedia() method had failed to retrieve both audio and video tracks.

  • streamId {String}

    The Stream ID.


mediaAccessSuccess

  Defined in: source/skylink-events.js:208      Available since 0.1.0

Event triggered when retrieval of Stream is successful.

Event Payload:

  • stream {MediaStream}

    The Stream object. To attach it to an element: attachMediaStream(videoElement, stream);.

  • isScreensharing {Boolean}

    The flag if event occurred during shareScreen() method and not getUserMedia() method.

  • isAudioFallback {Boolean}

    The flag if event occurred during retrieval of audio tracks only when getUserMedia() method had failed to retrieve both audio and video tracks.

  • streamId {String}

    The Stream ID.


peerConnectionState

  Defined in: source/skylink-events.js:135      Available since 0.1.0

Learn more about how ICE works in this article here.
Event triggered when a Peer connection session description exchanging state has changed.

Event Payload:

  • state {String}

    The current Peer connection session description exchanging state. [Rel: Skylink.PEER_CONNECTION_STATE]

  • peerId {String}

    The Peer ID.


peerJoined

  Defined in: source/skylink-events.js:249      Available since 0.5.2

Event triggered when a Peer joins the room.

Event Payload:

  • peerId {String}

    The Peer ID.

  • peerInfo {JSON}

    The Peer session information.

    • userData {JSON | String}

      The Peer current custom data.

    • settings {JSON}

      The Peer sending Stream settings.

      • data {Boolean | JSON}
        The flag if Peer has any Datachannel connections enabled. If isSelf value is true, this determines if User allows Datachannel connections, else if value is false, this determines if Peer has any active Datachannel connections (where dataChannelState event triggers state as OPEN and channelType as MESSAGING for Peer) with Peer.
      • audio {Boolean | JSON}
        The Peer Stream audio settings. When defined as false, it means there is no audio being sent from Peer. When defined as true, the peerInfo.settings.audio.stereo value is considered as false and the peerInfo.settings.audio.exactConstraints value is considered as false.
      • audio.stereo {Boolean}
        The flag if stereo band is configured when encoding audio codec is OPUS for receiving audio data.
      • audio.usedtx {Boolean} Optional
        Note that this feature might not work depending on the browser support and implementation.
        The flag if DTX (Discontinuous Transmission) is configured when encoding audio codec is OPUS for sending audio data. This might help to reduce bandwidth it reduces the bitrate during silence or background noise. When not defined, the default browser configuration is used.
      • audio.useinbandfec {Boolean} Optional
        Note that this feature might not work depending on the browser support and implementation.
        The flag if capability to take advantage of in-band FEC (Forward Error Correction) is configured when encoding audio codec is OPUS for sending audio data. This might help to reduce the harm of packet loss by encoding information about the previous packet. When not defined, the default browser configuration is used.
      • audio.maxplaybackrate {Number} Optional
        Note that this feature might not work depending on the browser support and implementation.
        The maximum output sampling rate rendered in Hertz (Hz) when encoding audio codec is OPUS for sending audio data. This value must be between 8000 to 48000. When not defined, the default browser configuration is used.
      • audio.echoCancellation {Boolean}
        The flag if echo cancellation is enabled for audio tracks.
      • audio.optional {Array} Optional
        The Peer Stream navigator.getUserMedia() API audio: { optional [..] } property.
      • audio.deviceId {String} Optional
        The Peer Stream audio track source ID of the device used.
      • audio.exactConstraints {Boolean}
        The flag if Peer Stream audio track is sending exact requested values of peerInfo.settings.audio.deviceId when provided.
      • video {Boolean | JSON}
        The Peer Stream video settings. When defined as false, it means there is no video being sent from Peer. When defined as true, the peerInfo.settings.video.screenshare value is considered as false and the peerInfo.settings.video.exactConstraints value is considered as false.
      • video.resolution {JSON} Optional
        The Peer Stream video resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number | JSON}
        The Peer Stream video resolution width or video resolution width settings. When defined as a JSON object, it is the user set resolution width settings with ("min" or "max" or "ideal" or "exact" etc configurations).
      • video.resolution.height {Number | JSON}
        The Peer Stream video resolution height or video resolution height settings. When defined as a JSON object, it is the user set resolution height settings with ("min" or "max" or "ideal" or "exact" etc configurations).
      • video.frameRate {Number | JSON} Optional
        The Peer Stream video frameRate per second (fps) or video frameRate settings. When defined as a JSON object, it is the user set frameRate settings with ("min" or "max" or "ideal" or "exact" etc configurations).
      • video.screenshare {Boolean}
        The flag if Peer Stream is a screensharing Stream.
      • video.optional {Array} Optional
        The Peer Stream navigator.getUserMedia() API video: { optional [..] } property.
      • video.deviceId {String} Optional
        The Peer Stream video track source ID of the device used.
      • video.exactConstraints {Boolean}
        The flag if Peer Stream video track is sending exact requested values of peerInfo.settings.video.resolution, peerInfo.settings.video.frameRate and peerInfo.settings.video.deviceId when provided.
      • video.facingMode {String | JSON} Optional
        The Peer Stream video camera facing mode. When defined as a JSON object, it is the user set facingMode settings with ("min" or "max" or "ideal" or "exact" etc configurations).
      • bandwidth {JSON}
        The maximum streaming bandwidth sent from Peer.
      • bandwidth.audio {Number} Optional
        The maximum audio streaming bandwidth sent from Peer.
      • bandwidth.video {Number} Optional
        The maximum video streaming bandwidth sent from Peer.
      • bandwidth.data {Number} Optional
        The maximum data streaming bandwidth sent from Peer.
      • googleXBandwidth {JSON}
        Note that this feature might not work depending on the browser support and implementation, and its properties and values are only defined for User's end and cannot be viewed from Peer's end (when isSelf value is false).
        The experimental google video streaming bandwidth sent to Peers.
      • googleXBandwidth.min {Number} Optional
        The minimum experimental google video streaming bandwidth sent to Peers.
      • googleXBandwidth.max {Number} Optional
        The maximum experimental google video streaming bandwidth sent to Peers.
    • mediaStatus {JSON}

      The Peer Stream muted settings.

      • audioMuted {Boolean}
        The flag if Peer Stream audio tracks is muted or not. If Peer peerInfo.settings.audio is false, this will be defined as true.
      • videoMuted {Boolean}
        The flag if Peer Stream video tracks is muted or not. If Peer peerInfo.settings.video is false, this will be defined as true.
    • agent {JSON}

      The Peer agent information.

      • name {String}
        The Peer agent name. Data may be accessing browser or non-Web SDK name.
      • version {Number}
        The Peer agent version. Data may be accessing browser or non-Web SDK version. If the original value is "0.9.6.1", it will be interpreted as 0.90601 where 0 helps to seperate the minor dots.
      • os {String} Optional
        The Peer platform name. Data may be accessing OS platform version from Web SDK.
      • pluginVersion {String} Optional
        The Peer Temasys Plugin version. Defined only when Peer is using the Temasys Plugin (IE / Safari).
      • DTProtocolVersion {String}
        The Peer data transfer (DT) protocol version.
      • SMProtocolVersion {String}
        The Peer signaling message (SM) protocol version.
    • room {String}

      The Room Peer is from.

    • config {JSON}

      The Peer connection configuration.

      • enableIceTrickle {Boolean}
        The flag if Peer connection has trickle ICE enabled or faster connectivity.
      • enableDataChannel {Boolean}
        The flag if Datachannel connections would be enabled for Peer.
      • enableIceRestart {Boolean}
        The flag if Peer connection has ICE connection restart support. Note that ICE connection restart support is not honoured for MCU enabled Peer connection.
      • priorityWeight {Number}
        The flag if Peer or User should be the offerer. If User's priorityWeight is higher than Peer's, User is the offerer, else Peer is. However for the case where the MCU is connected, User will always be the offerer.
      • publishOnly {Boolean}
        The flag if Peer is publishing only stream but not receiving streams.
      • receiveOnly {Boolean}
        The flag if Peer is receiving only streams but not publishing stream.
    • parentId {String} Optional

      The parent Peer ID that it is matched to for multi-streaming connections.

    • connected {Boolean} Optional

      The flag if Peer ICE connection has been established successfully. Defined only when isSelf payload value is false.

    • init {Boolean} Optional

      The flag if Peer connection has been created successfully. Defined only when isSelf payload value is false.

  • isSelf {Boolean}

    The flag if Peer is User.


peerLeft

  Defined in: source/skylink-events.js:401      Available since 0.5.2

Event triggered when a Peer leaves the room.

Event Payload:

  • peerId {String}

    The Peer ID.

  • peerInfo {JSON}

    The Peer session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.

  • isSelf {Boolean}

    The flag if Peer is User.


peerRestart

  Defined in: source/skylink-events.js:374      Available since 0.5.5

Event triggered when a Peer connection has been refreshed.

Event Payload:

  • peerId {String}

    The Peer ID.

  • peerInfo {JSON}

    The Peer session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.

  • isSelfInitiateRestart {Boolean}

    The flag if User is initiating the Peer connection refresh.

  • isIceRestart {Boolean}

    The flag if Peer connection ICE connection will restart.


peerUpdated

  Defined in: source/skylink-events.js:388      Available since 0.5.2

Event triggered when a Peer session information has been updated.

Event Payload:

  • peerId {String}

    The Peer ID.

  • peerInfo {JSON}

    The Peer session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.

  • isSelf {Boolean}

    The flag if Peer is User.


readyStateChange

  Defined in: source/skylink-events.js:90      Available since 0.4.0

Event triggered when init() method ready state changes.

Event Payload:

  • readyState {Number}

    The current init() ready state. [Rel: Skylink.READY_STATE_CHANGE]

  • error {JSON} Optional

    The error result. Defined only when state is ERROR.

    • status {Number}

      The HTTP status code when failed.

    • errorCode {Number}

      The ready state change failure code. [Rel: Skylink.READY_STATE_CHANGE_ERROR]

    • content {Error}

      The error object.

  • room {String}

    The Room to The Room to retrieve session token for.


recordingState

beta
  Defined in: source/skylink-events.js:778      Available since 0.6.16

Event triggered when recording session state has changed.

Event Payload:

  • state {Number}

    The current recording session state. [Rel: Skylink.RECORDING_STATE]

  • recordingId {String}

    The recording session ID.

  • link {JSON}

    The recording session mixin videos link in MP4 format. Defined only when state payload is LINK.

    • #peerId {String}

      The recording session recorded Peer only video associated with the Peer ID defined in #peerId property. If #peerId value is "mixin", it means that is the mixin video of all Peers in the Room.

  • error {Error | String}

    The error object. Defined only when state payload is ERROR.


roomLock

  Defined in: source/skylink-events.js:554      Available since 0.5.2

Event triggered when Room locked status has changed.

Event Payload:

  • isLocked {Boolean}

    The flag if Room is locked.

  • peerId {String}

    The Peer ID.

  • peerInfo {JSON}

    The Peer session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.

  • isSelf {Boolean}

    The flag if User changed the Room locked status.


serverPeerJoined

  Defined in: source/skylink-events.js:685      Available since 0.6.1

Event triggered when a server Peer joins the room.

Event Payload:

  • peerId {String}

    The Peer ID.

  • serverPeerType {String}

    The server Peer type [Rel: Skylink.SERVER_PEER_TYPE]


serverPeerLeft

  Defined in: source/skylink-events.js:696      Available since 0.6.1

Event triggered when a server Peer leaves the room.

Event Payload:

  • peerId {String}

    The Peer ID.

  • serverPeerType {String}

    The server Peer type [Rel: Skylink.SERVER_PEER_TYPE]


serverPeerRestart

  Defined in: source/skylink-events.js:707      Available since 0.6.1

Event triggered when a server Peer connection has been refreshed.

Event Payload:

  • peerId {String}

    The Peer ID.

  • serverPeerType {String}

    The server Peer type [Rel: Skylink.SERVER_PEER_TYPE]


sessionDisconnect

  Defined in: source/skylink-events.js:414      Available since 0.6.10

Event triggered when Room session has ended abruptly due to network disconnections.

Event Payload:

  • peerId {String}

    The User's Room session Peer ID.

  • peerInfo {JSON}

    The User's Room session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.


socketError

  Defined in: source/skylink-events.js:74      Available since 0.5.5

Event triggered when attempt to establish socket connection to Signaling server has failed.

Event Payload:

  • errorCode {Number}

    The socket connection error code. [Rel: Skylink.SOCKET_ERROR]

  • error {Error | String | Number}

    The error object.

  • type {String}

    The fallback state of the socket connection attempt. [Rel: Skylink.SOCKET_FALLBACK]

  • session {JSON}

    The socket connection session information. Object signature matches the session parameter payload received in the channelOpen event.


streamEnded

  Defined in: source/skylink-events.js:718      Available since 0.5.10

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.

Event Payload:

  • peerId {String}

    The Peer ID.

  • peerInfo {JSON}

    The Peer session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.

  • isSelf {Boolean}

    The flag if Peer is User.

  • isScreensharing {Boolean}

    The flag if Peer Stream is a screensharing Stream.

  • streamId {String}

    The Stream ID.


streamMuted

  Defined in: source/skylink-events.js:735      Available since 0.6.1

Event triggered when Peer Stream audio or video tracks has been muted / unmuted.

Event Payload:

  • peerId {String}

    The Peer ID.

  • peerInfo {JSON}

    The Peer session information. Object signature matches the peerInfo parameter payload received in the peerJoined event.

  • isSelf {Boolean}

    The flag if Peer is User.

  • isScreensharing {Boolean}

    The flag if Peer Stream is a screensharing Stream.


systemAction

  Defined in: source/skylink-events.js:672      Available since 0.5.1

Event triggered when Signaling server reaction state has changed.

Event Payload:

  • action {String}

    The current Signaling server reaction state. [Rel: Skylink.SYSTEM_ACTION]

  • message {String}

    The message.

  • reason {String}

    The Signaling server reaction state reason of action code. [Rel: Skylink.SYSTEM_ACTION_REASON]