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


Before using Skylink

Please invoke init() method first to initialise the Application Key before using any functionalities in Skylink.

If you do not have an Application Key, you may register for a Skylink platform developer account to create one.

To get started you may visit the getting started page, or alternatively fork a ready made demo application that uses Skylink Web SDK at getaroom.io.

For tips on using skylink and troubleshooting you can visit our support portal.




  Skylink ()   _ACKProtocolHandler   _addIceCandidateFromQueue   _addIceCandidateToQueue   _addLocalMediaStreams   _addPeer   _addSDPStereo   _answerHandler   _approachEventHandler   _assembleDataURL   _base64ToBlob   _blobToBase64   _byeHandler   _CANCELProtocolHandler   _candidateHandler   _chunkBlobData   _chunkDataURL   _clearAllStoredLogsFn   _clearDataChannelTimeout   _closeChannel   _closeDataChannel   _condition   _createDataChannel   _createPeerConnection   _createSocket   _dataChannelProtocolHandler   _DATAProtocolHandler   _doAnswer   _doOffer   _enterHandler   _ERRORProtocolHandler   _getStoredLogsFn   _initSelectedRoom   _inRoomHandler   _introduceErrorEventHandler   _loadInfo   _logFn   _MESSAGEProtocolHandler   _muteAudioEventHandler   _muteLocalMediaStreams   _muteVideoEventHandler   _offerHandler   _onAddIceCandidateFailure   _onAddIceCandidateSuccess   _onIceCandidate   _onRemoteStreamAdded   _onUserMediaError   _onUserMediaSuccess   _openChannel   _parseAudioStreamSettings   _parseBandwidthSettings   _parseDefaultMediaStreamSettings   _parseIceServers   _parseInfo   _parseMediaStreamSettings   _parseMutedSettings   _parseUserData   _parseVideoStreamSettings   _peerListEventHandler   _printAllStoredLogsFn   _privateMessageHandler   _processingSingleMessage   _processSigMessage   _publicMessageHandler   _redirectHandler   _removePeer   _removeSDPFirefoxH264Pref   _requestServerInfo   _restartHandler   _restartMCUConnection   _restartPeerConnection   _roomLockEventHandler   _sendBlobDataToPeer   _sendChannelMessage   _sendDataChannelMessage   _setDataChannelTimeout   _setIceServers   _setLocalAndSendMessage   _setSDPAudioCodec   _setSDPBitrate   _setSDPVideoCodec   _setSDPVideoResolution   _startDataTransfer   _startPeerConnectionHealthCheck   _stopPeerConnectionHealthCheck   _streamEventHandler   _throttle   _trigger   _updateUserEventHandler   _wait   _waitForLocalMediaStream   _waitForOpenChannel   _welcomeHandler   _WRQProtocolHandler   acceptDataTransfer   cancelBlobTransfer deprecated   cancelDataTransfer   disableAudio deprecated   disableVideo   enableAudio deprecated   enableVideo deprecated   generateUUID   getPeerInfo   getPeers   getUserData   getUserMedia   init   introducePeer   joinRoom   leaveRoom   lockRoom   muteStream   off   on   once   refreshConnection   respondBlobRequest deprecated   sendBlobData   sendMessage   sendP2PMessage   sendStream   sendURLData   setDebugMode   setLogLevel   setUserData   shareScreen   stopScreen   stopStream   unlockRoom   log.debug   log.error   log.info   log.log   log.warn   SkylinkLogs   SkylinkLogs.clearAllLogs   SkylinkLogs.getLogs   SkylinkLogs.printAllLogs   _appKey   _appKeyOwner   _audioFallback   _autoIntroduce   _channelOpen   _CHUNK_DATAURL_SIZE   _CHUNK_FILE_SIZE   _dataChannels   _dataTransfersTimeout   _DC_PROTOCOL_TYPE   _defaultRoom   _defaultStreamSettings   _downloadDataSessions   _downloadDataTransfers   _enableDataChannel   _enableDebugMode   _enableDebugStack   _enableDebugTrace   _enableIceTrickle   _enableSTUN   _enableTURN   _EVENTS   _forceSSL   _forceTURN   _forceTURNSSL   _getUserMediaSettings   _groupMessageList   _hasMCU   _hasMCU   _ICEConnectionFailures   _INTEROP_MULTI_TRANSFERS   _key   _lastRestart   _LOG_KEY   _LOG_LEVELS   _logLevel   _mediaScreen   _mediaScreenClone   _mediaStream   _mediaStreamsStatus   _MOZ_CHUNK_FILE_SIZE   _onceEvents   _parentKey   _path   _peerCandidatesQueue   _peerConnectionHealth   _peerConnectionHealthTimers   _peerConnections   _peerHSPriorities   _peerIceTrickleDisabled   _peerInformations   _peerList   _peerRestartPriorities   _readyState   _receiveOnly   _retryCount   _room   _roomCredentials   _roomDuration   _roomLocked   _roomServer   _roomStart   _screenSharingAvailable   _screenSharingGetUserMediaSettings   _screenSharingStreamSettings   _selectedAudioCodec   _selectedRoom   _selectedVideoCodec   _serverRegion   _SIG_MESSAGE_TYPE   _signalingServer   _signalingServerPort   _signalingServerProtocol   _socket   _socketMessageQueue   _socketMessageTimeout   _socketPorts   _socketTimeout   _socketUseXDR   _storedLogs   _streamSettings   _timestamp   _TRANSFER_DELIMITER   _TURNTransport   _uploadDataSessions   _uploadDataTransfers   _usePublicSTUN   _user   _userData   AUDIO_CODEC   CANDIDATE_GENERATION_STATE   DATA_CHANNEL_STATE   DATA_CHANNEL_TYPE   DATA_TRANSFER_DATA_TYPE   DATA_TRANSFER_STATE   DATA_TRANSFER_TYPE   DT_PROTOCOL_VERSION   GET_PEERS_STATE   HANDSHAKE_PROGRESS   ICE_CONNECTION_STATE   INTRODUCE_STATE   isPrivileged   log   LOG_LEVEL   PEER_CONNECTION_STATE   READY_STATE_CHANGE   READY_STATE_CHANGE_ERROR   REGIONAL_SERVER deprecated   SERVER_PEER_TYPE   SM_PROTOCOL_VERSION   SOCKET_ERROR   SOCKET_FALLBACK   SYSTEM_ACTION   SYSTEM_ACTION_REASON   TURN_TRANSPORT   VERSION   VIDEO_CODEC   VIDEO_RESOLUTION   candidateGenerationState   channelClose   channelError   channelMessage   channelOpen   channelRetry   dataChannelState   dataTransferState   getPeersStateChange   handshakeProgress   iceConnectionState   incomingData   incomingDataRequest   incomingMessage   incomingStream   introduceStateChange   mediaAccessError   mediaAccessRequired   mediaAccessStopped   mediaAccessSuccess   peerConnectionState   peerJoined   peerLeft   peerRestart   peerUpdated   readyStateChange   roomLock   serverPeerJoined   serverPeerLeft   serverPeerRestart   socketError   streamEnded   streamMuted   systemAction
  Scroll to top

_ACKProtocolHandler

( peerId ,   data ,   channelName ,   )
private
  Defined in: source/data-transfer.js:694      Available since 0.5.2

Handles the ACK Protocol request received from the DataChannel connection.

Triggers:

dataTransferState

Parameters:

  • peerId {String}

    The Peer ID associated with the DataChannel connection.

  • data {JSON}

    The data object received from the DataChannel connection. This should contain the ACK payload.

    • ackN {Number}

      The ACK response of the current data transfer. If 0, it means that the request has been accepted and the sending Peer has to send the first data transfer packet (chunk). If it's greater than 0, it means that the previous data transfer packet (chunk) has been received and is expecting for the next data transfer packet. The number always increment based on the number of data packets the receiving end has received. If it's -1, it means that the data transfer request has been rejected and the data transfer will be terminated.

    • sender {String}

      The Peer ID of sender.

    • type {String}

      Protocol step "ACK".

  • channelName {String}

    The DataChannel connection ID associated with the transfer.


_addIceCandidateFromQueue

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

Adds the list of ICE candidates bufferred before RTCPeerConnection.setRemoteDescription is called associated with the Peer connection.

Parameters:

  • targetMid {String}

    The Peer ID to add the associated bufferred ICE candidates.


_addIceCandidateToQueue

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

Buffers an ICE candidate object associated with a Peer connection to prevent disruption to ICE connection when ICE candidate is received before RTCPeerConnection.setRemoteDescription is called.

Parameters:

  • targetMid {String}

    The Peer ID associated with the ICE candidate object.

  • candidate {Object}

    The constructed ICE candidate object.


_addLocalMediaStreams

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

Sends self selected Stream object to current Peer connections. If _mediaScreen is not empty, it will send the screensharing stream, else it will send the _mediaStream if is not empty. If self does not have any Stream object to send, it will a connection without any remote Stream sent to the Peer connection.

Parameters:

  • peerId {String}

    The Peer ID of the connection to send Stream object to.


_addPeer

( targetMid ,   peerBrowser ,   [toOffer=false] ,   [restartConn=false] ,   [receiveOnly=false] ,   [isSS=false] ,   )
private
  Defined in: source/peer-connection.js:94      Available since 0.5.4

Connects to the Peer.

Parameters:

  • targetMid {String}

    The Peer ID to connect to.

  • peerBrowser {JSON}

    The Peer platform agent information.

    • agent {String}

      The Peer platform browser or agent name.

    • version {Number}

      The Peer platform browser or agent version.

    • os {Number}

      The Peer platform name.

  • toOffer {Boolean} Optional
    DEFAULT: false

    The flag that indicates if the Peer connection should be start connection as an offerer or as an answerer.

  • restartConn {Boolean} Optional
    DEFAULT: false

    The flag that indicates if the Peer connection is part of restart functionality use-case.

  • receiveOnly {Boolean} Optional
    DEFAULT: false

    The flag that indicates if the Peer connection would send Stream or not (receive only).

  • isSS {Boolean} Optional
    DEFAULT: false

    The flag that indicates if the Peer connection Stream sent is a screensharing stream or not.


_addSDPStereo

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

Modifies the array of session description received to enable stereo in the audio streaming connection.

Parameters:

  • sdpLines {Array}

    The array of lines in the session description.

Returns:

{Array}:

The updated array of lines in the session description with the stereo feature.


_answerHandler

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

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

Triggers:

handshakeProgress

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • sdp {String}

      The generated answer session description.

    • mid {String}

      The Peer ID associated with this message.

    • target {String}

      The targeted Peer ID to receive the message object.

    • type {String}

      Protocol step "answer".


_approachEventHandler

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

Handles the APPROACH message event received from the platform signaling.

Parameters:

  • message {JSON}

    The message object received from platform signaling.

    • type {String}

      Protocol step "approach".

    • target {Object}

      The peer to initiate the handshake to


_assembleDataURL

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

Assembles the data string chunks of a chunked dataURL binary string (base64) into the original dataURL binary string (base64).

Parameters:

  • dataURLArray {Array}

    The array of chunked dataURL binary strings (base64) based on the dataURL string provided.

Returns:

{String}:

The original huge dataURL binary string (base64).


_base64ToBlob

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

Converts a binary string (base64) derived from dataURL conversion to a Blob data object.
Author: devnull69@stackoverflow.com #6850276

Parameters:

  • dataURL {String}

    The binary string (base64) to convert.

Returns:

{Blob}:

The converted Blob data object.


_blobToBase64

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

Converts a Blob data object into a binary string (base64) using dataURL conversion

Parameters:

  • data {Blob}

    The Blob data object to convert.

  • callback {Function}

    The callback triggered when Blob data conversion to binary string (base64) has completed.

    • data {String}

      The converted binary string (base64).


_byeHandler

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

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

Triggers:

peerLeft

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • type {String}

      Protocol step "bye".


_CANCELProtocolHandler

( senderPeerId ,   data ,   channelName ,   )
private
  Defined in: source/data-transfer.js:937      Available since 0.5.0

Handles the CANCEL Protocol request received from the DataChannel connection.

Triggers:

dataTransferState

Parameters:

  • senderPeerId {String}

    The Peer ID associated with the DataChannel connection.

  • data {JSON}

    The data object received from the DataChannel connection. This should contain the CANCEL payload.

    • name {String}

      The transfer data object name.

    • content {String}

      The reason for termination as a message.

    • sender {String}

      The Peer ID of the sender.

    • type {String}

      Protocol step "CANCEL".

  • channelName {String}

    The DataChannel connection ID associated with the transfer.


_candidateHandler

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

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

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • id {String}

      The ICE candidate identifier of the "media stream identification" for the m-line this candidate is associated with if present. The value is retrieved from RTCIceCandidate.sdpMid.

    • label {String}

      The ICE candidate index (starting at zero) of the m-line in the SDP this candidate is associated with. The value is retrieved from RTCIceCandidate.sdpMLineIndex.

    • candidate {String}

      The ICE candidate candidate-attribute. The value is retrieved from RTCIceCandidate.candidate.

    • target {String}

      The targeted Peer ID to receive the message object.

    • type {String}

      Protocol step: "candidate".


_chunkBlobData

( blob ,   chunkSize ,   )
private
  Defined in: source/data-process.js:125      Available since 0.5.2

Chunks a huge Blob data object into smaller Blob data object chunks based on the chunk sizes provided. If provided Blob data object is smaller than chunk sizes, it will return an array length of 1 with the Blob data object.

Parameters:

  • blob {Blob}

    The huge Blob binary data object.

  • chunkSize {Number}

    The chunk size that the Blob binary data should be cut into.

Returns:

{Array}:

The array of chunked Blob data objects based on the Blob data object provided.


_chunkDataURL

( dataURL ,   chunkSize ,   )
private
  Defined in: source/data-process.js:164      Available since 0.6.1

Chunks a huge dataURL binary string (base64) into smaller strings based on the chunk length provided. If provided dataURL binary string (base64) is smaller than chunk length, it will return an array length of 1 with the dataURL string.

Parameters:

  • dataURL {String}

    The huge dataURL binary string (base64).

  • chunkSize {Number}

    The string (chunk) length that the dataURL binary string (base64) should be cut into.

Returns:

{Array}:

The array of chunked dataURL binary strings (base64) based on the dataURL string provided.


_clearAllStoredLogsFn

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

Clears the stored Skylink console logs in _storedLogs.

Parameters:

  • logLevel {Number} Optional

    The specific log level of Skylink console logs that should be cleared. If value is not provided, it will clear all stored console logs. [Rel: Skylink.LOG_LEVEL]


_clearDataChannelTimeout

( peerId ,   [isSender=false] ,   channelName ,   )
private
  Defined in: source/data-transfer.js:293      Available since 0.5.0

Stops and clears the waitig timeout for the associated DataChannel connection.

Parameters:

  • peerId {String}

    The Peer ID associated with the DataChannel connection.

  • isSender {Boolean} Optional
    DEFAULT: false

    The flag thats indicates if the response is related to a downloading or uploading data transfer.

  • channelName {String}

    The DataChannel connection ID.


_closeChannel

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

Disconnects the current socket connection with the platform signaling.


_closeDataChannel

( peerId ,   [channelName] ,   )
private
  Defined in: source/data-channel.js:340      Available since 0.1.0

Stops DataChannel connections associated with a Peer connection and remove any object references to the DataChannel connection(s).

Triggers:

dataChannelState

Parameters:

  • peerId {String}

    The Peer ID associated with the DataChannel connection(s) to close.

  • channelName {String} Optional

    The targeted DataChannel channelName to close the connection with. If channelName is not provided, all associated DataChannel connections with the Peer connection would be closed.


_condition

( eventName ,   callback ,   [checkFirst] ,   [condition] ,   [fireAlways=false] ,   )
private
  Defined in: source/skylink-events.js:1358      Available since 0.5.5

Checks if the first condition is already met before doing an event handler subscription to wait for the second condition to be met. This method will do a event subscription with once() as this _condition() would only trigger once, unless fireAlways is set to true.

Parameters:

  • eventName {String}

    The Skylink event name to subscribe to.

  • callback {Function}

    The event handler to subscribe to the associated Skylink event name to trigger once the condition has met. If fireAlways option is set to true, this will always be fired when condition is met.

  • checkFirst {Function} Optional

    The first condition to check before doing an event subscription to wait for second condition to meet. Return in the first condition function true to pass as meeting the condition. If the first condition is met, the event handler would be triggered and the event handler will not be subscribed to the event or wait for second condition to pass.

  • condition {Function} Optional

    The second condition function that once the it has been met, it will trigger the event handler once. Return in the second condition function true to pass as meeting the condition. If the second condition is met, the event handler would be triggered and depending if fireAlways option is set to true, this will always be fired when condition is met.

  • fireAlways {Boolean} Optional
    DEFAULT: false

    The flag that indicates if Skylink should interrupt the second condition function once the function has been triggered to not unsubscribe the event handler but to always trigger when the second condition has been met.


_createDataChannel

( peerId ,   channelType ,   [dataChannel] ,   customChannelName ,   )
private
  Defined in: source/data-channel.js:89      Available since 0.5.5

Starts a DataChannel connection with a Peer connection. If the DataChannel is provided in the parameter, it simply appends event handlers to check the current state of the DataChannel.

Triggers:

dataChannelState

Parameters:

  • peerId {String}

    The Peer ID to start the DataChannel with or associate the provided DataChannel object connection with.

  • channelType {String}

    The DataChannel functionality type. [Rel: Skylink.DATA_CHANNEL_TYPE]

  • dataChannel {Object} Optional

    The RTCDataChannel object received in the Peer connection .ondatachannel event.

  • customChannelName {String}

    The custom RTCDataChannel label name to identify the different opened channels.

Returns:

{Object}:

The DataChannel connection object associated with the provided Peer ID.


_createPeerConnection

( targetMid ,   [isScreenSharing=false] ,   )
private
  Defined in: source/peer-connection.js:353      Available since 0.5.1

Creates a Peer connection. This does not start the handshake connection but creates the Peer connection object ready for connection.

Parameters:

  • targetMid {String}

    The Peer ID to create the connection object with.

  • isScreenSharing {Boolean} Optional
    DEFAULT: false

    The flag that indicates if the Peer connection Stream sent is a screensharing stream or not.

Returns:

{Object}:

The Peer connection object associated with the provided ID.


_createSocket

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

Starts a socket.io connection with the platform signaling.

Parameters:

  • type {String}

    The transport type of socket.io connection to use.

    • "WebSocket": Uses the WebSocket connection.
      options.transports = ["websocket"]
    • "Polling": Uses the Polling connection.
      options.transports = ["xhr-polling", "jsonp-polling", "polling"]

_dataChannelProtocolHandler

( data ,   senderPeerId ,   channelName ,   channelType ,   )
private
  Defined in: source/data-transfer.js:551      Available since 0.5.2

Routes the data received to the relevant Protocol handler based on the data received.

Parameters:

  • data {String | Object}

    The data received from the DataChannel connection.

  • senderPeerId {String}

    The Peer ID associated with the DataChannel connection.

  • channelName {String}

    The DataChannel connection ID.

  • channelType {String}

    The DataChannel connection functionality type. [Rel: Skylink.DATA_CHANNEL_TYPE]


_DATAProtocolHandler

( senderPeerId ,   dataString ,   dataType ,   channelName ,   )
private
  Defined in: source/data-transfer.js:1026      Available since 0.5.5

Handles the DATA Protocol request received from the DataChannel connection. In this handler, it actually handles and manipulates the received data transfer packet.

Triggers:

dataTransferState

Parameters:

  • senderPeerId {String}

    The Peer ID associated with the DataChannel connection.

  • dataString {ArrayBuffer | Blob | String}

    The data transfer packet (chunk) received.

  • dataType {String}

    The data transfer packet (chunk) data type received. [Rel: Skylink.DATA_TRANSFER_DATA_TYPE]

  • channelName {String}

    The DataChannel connection ID associated with the transfer.


_doAnswer

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

Responses to the OFFER session description received and creates an ANSWER session description to sent to the associated Peer to complete the WebRTC handshake layer.

Parameters:

  • targetMid {String}

    The Peer ID to send the ANSWER to.


_doOffer

( targetMid ,   peerBrowser ,   )
private
  Defined in: source/peer-handshake.js:102      Available since 0.5.2

Starts to initiate the WebRTC layer of handshake connection by creating the OFFER session description and then sending it to the associated Peer. The offerer status may be shifted to the other peer depending on when version of browser that is initiating the connection to what version of browser to.

Parameters:

  • targetMid {String}

    The Peer ID to send the OFFER to.

  • peerBrowser {JSON}

    The Peer platform agent information.

    • name {String}

      The Peer platform browser or agent name.

    • version {Number}

      The Peer platform browser or agent version.

    • os {Number}

      The Peer platform name.


_enterHandler

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

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

Triggers:

handshakeProgress, peerJoined

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • receiveOnly {Boolean} Optional
      DEFAULT: false

      The flag that indicates if the Peer connection would send Stream or not (receive only).

    • userInfo {JSON}

      The peer information associated with the Peer Connection.

      • userData {String | JSON}
        The custom user data information set by developer. This custom user data can also be set in setUserData().
      • settings {JSON}
        The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.
      • settings.audio {Boolean | JSON} Optional
        DEFAULT: false The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • settings.audio.stereo {Boolean} Optional
        The flag that indicates if stereo should be enabled in the Peer connection Stream audio streaming.
      • settings.video {Boolean | JSON} Optional
        DEFAULT: false The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • settings.video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • settings.video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • settings.video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • settings.video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • settings.video.screenshare {Boolean} Optional
        DEFAULT: false The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • settings.bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • settings.bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • settings.bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • settings.bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
      • mediaStatus {JSON}
        The Peer Stream mute settings for both audio and video streamings.
      • mediaStatus.audioMuted {Boolean} Optional
        DEFAULT: true The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • mediaStatus.videoMuted {Boolean} Optional
        DEFAULT: true The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent.name {String}

      The Peer platform browser or agent name.

    • version {Number}

      The Peer platform browser or agent version.

    • os {Number}

      The Peer platform name.

    • sessionType {String}

      The Peer connection remote Stream streaming session type. If value is "stream", the Stream streaming session is normal user media streaming, else if it is "screensharing", the Stream streaming session is screensharing session.

    • type {String}

      Protocol step "enter".


_ERRORProtocolHandler

( senderPeerId ,   data ,   channelName ,   )
private
  Defined in: source/data-transfer.js:886      Available since 0.5.2

Handles the ERROR Protocol request received from the DataChannel connection.

Triggers:

dataTransferState

Parameters:

  • senderPeerId {String}

    The Peer ID associated with the DataChannel connection.

  • data {JSON}

    The data object received from the DataChannel connection. This should contain the ERROR payload.

    • name {String}

      The transfer data object name.

    • content {String}

      The error message.

    • isUploadError {Boolean} Optional
      DEFAULT: false

      The flag thats indicates if the response is related to a downloading or uploading data transfer.

    • sender {String}

      The Peer ID of the sender.

    • type {String}

      Protocol step "ERROR".

  • channelName {String}

    The DataChannel connection ID associated with the transfer.


_getStoredLogsFn

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

Gets the stored Skylink console logs from _storedLogs.

Parameters:

  • logLevel {Number} Optional

    The specific log level of Skylink console logs that should be returned. If value is not provided, it will return all stored console logs. [Rel: Skylink.LOG_LEVEL]

Returns:

{Array}:

The array of stored console logs based on the log level provided.


_initSelectedRoom

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

Starts loading the required connection information to start connection based on the selected room in joinRoom().

Triggers:

readyStateChange

Parameters:

  • room {String} Optional

    The room to retrieve required connection information to start connection. If room is not provided, the room would default to the the defaultRoom option set in init() settings.

  • callback {Function}

    The callback fired after required connection information has been retrieved successfully with the provided media settings or have met with an exception.

    • error {Object}

      The error object received in the callback. If received as null, it means that there is no errors.


_inRoomHandler

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

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

Triggers:

peerJoined

Parameters:

  • message {JSON}

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

  • message {JSON}

    Expected IN_ROOM data object format.

    • {String}

      The room ID for identification to the platform signaling connection.

    • {String}

      The self session socket connection ID. This is used by the signalling socket connection as ID to target self and the peers Peer ID.

    • {JSON}

      The Peer connection iceServers configuration.

    • {String}

      Protocol step: "inRoom".


_introduceErrorEventHandler

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

Handles the INTRODUCE_ERROR message event received from the platform signaling.

Parameters:

  • message {JSON}

    The message object received from platform signaling.

    • type {String}

      Protocol step "introduceError".

    • reason {Object}

      The error message.

    • sendingPeerId {Object}

      Id of the peer initiating the handshake

    • receivingPeerId {Object}

      Id of the peer receiving the handshake


_loadInfo

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

Starts loading the required dependencies and then retrieve the required connection information from the platform server.

Triggers:

readyStateChange

_logFn

( logLevel ,   message ,   [0] ,   [debugObject] ,   )
private scoped
  Defined in: source/skylink-debug.js:262      Available since 0.5.5

Handles the Skylink logs and stores the console log message in _storedLogs if _enableDebugStack is set to true and prints out the log to the Web console.

Parameters:

  • logLevel {String}

    The console log message log level. [Rel: Skylink.LOG_LEVEL]

  • message {Array | String}

    The console log message contents.

    • 1 {String}

      The interface the message is associated with.

    • 2 {String | Array}

      Any additional message information that the message is associated with.

    • 3: {String}

      The console log message message data.

  • 0 {String} Optional

    The Peer ID the message is associated with.

  • debugObject {Object | String} Optional

    The console debugging message object to accompany and display that associates with the console log message.


_MESSAGEProtocolHandler

( peerId ,   data ,   channelName ,   )
private
  Defined in: source/data-transfer.js:856      Available since 0.5.2

Handles the MESSAGE Protocol request received from the DataChannel connection.

Triggers:

incomingMessage

Parameters:

  • peerId {String}

    The Peer ID associated with the DataChannel connection.

  • data {JSON}

    The data object received from the DataChannel connection. This should contain the MESSAGE payload.

    • target {String}

      The targeted Peer ID to receive the message object.

    • data {String | JSON}

      The message object.

    • sender {String}

      The Peer ID of the sender.

    • type {String}

      Protocol step "MESSAGE".

  • channelName {String}

    The DataChannel connection ID associated with the transfer.


_muteAudioEventHandler

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

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

Triggers:

peerUpdated

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • muted {Boolean}

      The flag that indicates if the remote Stream object audio streaming is muted.

    • type {String}

      Protocol step "muteAudioEvent".


_muteLocalMediaStreams

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

Handles the muting of audio and video streams in _mediaStream, _mediaScreen and _mediaScreenClone,

Returns:

{JSON}:

The information of the self MediaStream object attached to Skylink if they have the specified tracks for the stream settings.

  • return.hasAudioTracks: The flag that indicates if self MediaStream has audio tracks
  • return.hasVideoTracks: The flag that indicates if self MediaStream has video tracks


_muteVideoEventHandler

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

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

Triggers:

peerUpdated

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • muted {String}

      The flag that indicates if the remote Stream object video streaming is muted.

    • type {String}

      Protocol step "muteVideoEvent".


_offerHandler

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

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

Triggers:

handshakeProgress

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • sdp {String}

      The generated offer session description.

    • target {String}

      The targeted Peer ID to receive the message object.

    • type {String}

      Protocol step "offer".


_onAddIceCandidateFailure

( error ,   )
private
  Defined in: source/ice-candidate.js:152      Available since 0.5.9

Handles the event when adding an ICE candidate has failed. This is mainly to prevent JShint errors.

Parameters:

  • error {Object}

    The error received in the failure callback in RTCPeerConnection.addIceCandidate(candidate, successCb, failureCb).


_onAddIceCandidateSuccess

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

Handles the event when adding an ICE candidate has been added successfully. This is mainly to prevent JShint errors.


_onIceCandidate

( targetMid ,   event ,   )
private
  Defined in: source/ice-candidate.js:64      Available since 0.1.0

Handles the ICE candidate object received from associated Peer connection to send the ICE candidate object or wait for all gathering to complete before sending the candidate to prevent trickle ICE.

Triggers:

candidateGenerationState

Parameters:

  • targetMid {String}

    The Peer ID associated with the ICE candidate object received.

  • event {Event}

    The event object received in the RTCPeerConnection. onicecandidate to parse the ICE candidate and determine if gathering has completed.


_onRemoteStreamAdded

( targetMid ,   event ,   [isScreenSharing=false] ,   )
private
  Defined in: source/stream-media.js:615      Available since 0.5.2

Handles the event when remote MediaStream is received from Peer connection.

Triggers:

incomingStream

Parameters:

  • targetMid {String}

    The Peer ID associated with the remote Stream object received.

  • event {Event}

    The event object received in the RTCPeerConnection. onaddstream.

  • isScreenSharing {Boolean} Optional
    DEFAULT: false

    The flag that indicates if Peer connection Stream object is a screensharing stream or not.


_onUserMediaError

( error ,   [isScreenSharing=false] ,   )
private
  Defined in: source/stream-media.js:580      Available since 0.5.4

Handles the event when access to self user media MediaStream has failed.

Triggers:

mediaAccessError

Parameters:

  • error {Object}

    The error object thrown that caused the failure.

  • isScreenSharing {Boolean} Optional
    DEFAULT: false

    The flag that indicates if self Stream object is a screensharing stream or not.


_onUserMediaSuccess

( stream ,   [isScreenSharing=false] ,   )
private
  Defined in: source/stream-media.js:495      Available since 0.3.0

Handles the event when access to self user media MediaStream is successful.

Triggers:

mediaAccessSuccess

Parameters:

  • stream {MediaStream}

    The self user MediaStream object.

  • isScreenSharing {Boolean} Optional
    DEFAULT: false

    The flag that indicates if self Stream object is a screensharing stream or not.


_openChannel

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

Connects to the socket connection endpoint URI to platform signaling that is constructed with _signalingServerProtocol, _signalingServer and _signalingServerPort. Example format: protocol//serverUrl:port.
Once URI is formed, it will start a new socket.io connection with _createSocket().

Triggers:

channelMessage, channelOpen, channelError, channelClose

_parseAudioStreamSettings

( [options=false] ,   )
private
  Defined in: source/stream-media.js:662      Available since 0.5.5

Parses the audio stream settings for self provided.

Parameters:

  • options {Boolean | JSON} Optional
    DEFAULT: false

    The flag that indicates if self user media MediaStream would have audio streaming.

    • mute {Boolean} Optional
      DEFAULT: false

      The flag that indicates if the self Stream object audio streaming is muted.

    • optional {Array} Optional

      The optional constraints for audio streaming in self user media Stream object. Some of the values are set by the audio.optional setting in getUserMedia().

Returns:

{JSON}:

The parsed audio stream settings for self.

  • return.settings: The output audio stream settings information for self
  • return.userMedia: The output audio MediaStreamConstraints to be passed into getUserMedia()


_parseBandwidthSettings

( [options] ,   )
private
  Defined in: source/stream-media.js:822      Available since 0.5.5

Parses the streaming bandwidth settings for self provided.

Parameters:

  • options {String} Optional

    The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.

    • audio {String} Optional

      The configured audio stream channel for self connection Stream object bandwidth that audio streaming should use in kb/s.

    • video {String} Optional

      The configured video stream channel for the self connection Stream object bandwidth that video streaming should use in kb/s.

    • data {String} Optional

      The configured datachannel channel for self DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.


_parseDefaultMediaStreamSettings

( defaults ,   )
private
  Defined in: source/stream-media.js:930      Available since 0.5.7

Parses the default stream settings received from the platform signaling.

Parameters:

  • defaults {JSON}

    The default user media settings.

    • maxHeight {Number} Optional

      The default user media MediaStream video streaming resolution maximum height.

    • maxWidth {Number} Optional

      The default user media MediaStream video streaming resolution maximum width.


_parseIceServers

( config ,   )
private
  Defined in: source/ice-connection.js:157      Available since 0.6.1

Reconfigures the RTCConfiguration.iceServers that is to be passed in constructing the new RTCPeerConnection object for different browsers support. Previously known as _setFirefoxIceServers. This method will reconfigure urls configuration to an array of url configuration.

Parameters:

  • config {JSON}

    The RTCConfiguration that is to be passed for constructing the new RTCPeerConnection object.

Returns:

{JSON}:

The updated RTCConfiguration object with Firefox specific STUN configuration.


_parseInfo

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

Parses the connection information retrieved from the platform server and stores them into the relevant attributes in _room and _user.

Triggers:

readyStateChange

Parameters:

  • info {JSON}

    The HTTP response data if the HTTP status code is 200 (which means HTTP OK code)

    • pc_constraints {String}

      The RTCPeerConnection constraints. The data is in JSON stringified string and requires converting the JSON string to an JSON object to use the object.

    • media_constraints {String}

      The getUserMedia() MediaStreamConstraints. The data is in JSON stringified string and requires converting the JSON string to an JSON object to use the object.

    • offer_constraints {String}

      The RTCPeerConnection RTCOfferOptions. The data is in JSON stringified string and requires converting the JSON string to an JSON object to use the object.

    • bandwidth {String}

      The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.

      • audio {String}
        The default audio stream channel for self Stream object bandwidth that audio streaming should use in kb/s.
      • video {String}
        The default video stream channel for self Stream object bandwidth that video streaming should use in kb/s.
      • data {String}
        The default datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • cid {String}

      The Skylink server connection key for starting the selected room connection.

    • apiOwner {String}

      The Skylink server Application Key owner string for the selected room.

    • httpPortList {Array}

      The list of HTTP ports for reconnection retries.

      • (#index) {Number}
        The HTTP port that Skylink could reattempt to establish for a signaling connection with http: protocol.
    • httpsPortList {Array}

      The list of HTTPS ports for reconnection retries.

      • (#index) {Number}
        The HTTPS port that Skylink could reattempt to establish for a signaling connection with https: protocol or when {{#crossLink "Skylink/_forceSSL:attribute"}}_forceSSL{{/crossLink}} is enabled.
    • ipSigserver {String}

      The platform signaling endpoint URI to open socket connection with.

    • roomCred {String}

      The generated room token given by the platform server for starting the platform signaling connection.

    • room_key {String}

      For success state. The room ID for identification to the platform signaling connection.

    • start {String}

      The start datetime stamp (in The startDateTime in (ISO 8601 format) that the call has started sent by the platform server as an indication for the starting datetime of the platform signaling connection to self.

    • timeStamp {String}

      The self session timestamp.

    • userCred {String}

      The self session access token.

    • username {String}

      The self session ID.


_parseMediaStreamSettings

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

Parses the provided stream settings for self provided.

Parameters:

  • options {JSON} Optional

    The self Stream streaming settings. If both audio and video option is false, there should be no audio and video stream sending from self connection.

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream audio user media access is given.

      • stereo {Boolean} Optional
        DEFAULT: false The flag that indicates if stereo should be enabled in self connection Stream audio streaming.
      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object audio streaming is muted.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming video settings. If false, it means that video streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream video user media access is given.

      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object video streaming is muted.
      • resolution {JSON} Optional
        The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Number} Optional
        The self Stream streaming video resolution width.
      • resolution.height {Number} Optional
        The self Stream streaming video resolution height.
      • frameRate {Number} Optional
        DEFAULT: 50 The self Stream streaming video maximum frameRate.
    • bandwidth {JSON} Optional

      The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.

      • audio {Number} Optional
        The configured audio stream channel for the self Stream object bandwidth that audio streaming should use in kb/s.
      • video {Number} Optional
        The configured video stream channel for the self Stream object bandwidth that video streaming should use in kb/s.
      • data {Number} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.

_parseMutedSettings

( [options] ,   [audio.stereo=false] ,   )
private
  Defined in: source/stream-media.js:862      Available since 0.5.5

Parses the mediaStatus settings for self provided.

Parameters:

  • options {JSON} Optional

    The self Stream streaming settings.

    • userData {String | JSON} Optional

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream audio user media access is given.

      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object audio streaming is muted.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming video settings. If false, it means that video streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream video user media access is given.

      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object video streaming is muted.
      • resolution {JSON} Optional
        The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Number} Optional
        The self Stream streaming video resolution width.
      • resolution.height {Number} Optional
        The self Stream streaming video resolution height.
      • frameRate {Number} Optional
        DEFAULT: 50 The self Stream streaming video maximum frameRate.
  • audio.stereo {Boolean} Optional
    DEFAULT: false

    The default flag that indicates if stereo should be enabled in self connection Stream audio streaming.

Returns:

{JSON}:

The parsed mediaStatus settings for self.

  • return.audioMuted: The flag that indicates if self connection Stream object audio streaming is muted. If there is no audio streaming enabled for self connection, by default, it is set to true.
  • return.videoMuted: The flag that indicates if self connection Stream object video streaming is muted. If there is no video streaming enabled for self connection, by default, it is set to true.


_parseUserData

( [userData] ,   )
private
  Defined in: source/peer-data.js:183      Available since 0.5.6

Parses the custom user data information for self provided.

Parameters:

  • userData {JSON} Optional

    The custom (or updated) user data information for self provided.


_parseVideoStreamSettings

( [options=false] ,   )
private
  Defined in: source/stream-media.js:721      Available since 0.5.8

Parses the video stream settings for self provided.

Parameters:

  • options {Boolean | JSON} Optional
    DEFAULT: false

    The self Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of self connection.

    • resolution {JSON} Optional

      The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]

      • width {Number} Optional
        The self Stream streaming video resolution width.
      • height {Number} Optional
        The self Stream streaming video resolution height.
    • frameRate {Number} Optional

      The self Stream streaming video maximum frameRate.

    • mute {Boolean} Optional
      DEFAULT: false

      The flag that indicates if the self Stream object video streaming is muted.

    • optional {Array} Optional

      The optional constraints for video streaming in self user media Stream object. Some of the values are set by the video.optional setting in getUserMedia().

Returns:

{JSON}:

The parsed video stream settings for self.

  • return.settings: The output video stream settings information for self
  • return.userMedia: The output video MediaStreamConstraints to be passed into getUserMedia()


_peerListEventHandler

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

Handles the PEER_LIST message event received from the platform signaling.

Parameters:

  • message.type {String}

    Protocol step: "peerList".

  • message {JSON}

    The message object received from platform signaling.

    • type {String}

      Protocol step: "peerList".

    • result {Object}

      The received resulting object E.g. {room1: [peer1, peer2], room2: ...}.


_printAllStoredLogsFn

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

Prints all the stored Skylink console logs into the Web console from _storedLogs.


_privateMessageHandler

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

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

Triggers:

incomingMessage

Parameters:

  • message {JSON}

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

    • data {JSON | String}

      The Message object.

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • cid {String}

      The Skylink server connection key for the selected room.

    • mid {String}

      The Peer ID associated with this message.

    • target {String}

      The targeted Peer ID to receive the message object.

    • type {String}

      Protocol step: "private".


_processingSingleMessage

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

Routes the data received to the relevant Protocol handler based on the socket message received.

Parameters:

  • message {JSON}

    The message object received.


_processSigMessage

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

Parses any GROUP type of message received and split them up to send them to Skylink/_processSingleMessage:method to handle the individual message object received. If the message is not GROUP type of message received, it will send it directly to Skylink/_processSingleMessage:method

Parameters:

  • messageString {String}

    The message object in JSON string.


_publicMessageHandler

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

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

Triggers:

incomingMessage

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • cid {String}

      The Skylink server connection key for the selected room.

    • muted {String}

      The flag to indicate if the User's audio stream is muted or not.

    • type {String}

      Protocol step: "public".


_redirectHandler

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

Handles the REDIRECT message event received from the platform signaling.

Triggers:

systemAction

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • info {String}

      The message received from the platform signaling when the system action and reason is given.

    • action {String}

      The system action that is received from the platform signaling. [Rel: Skylink.SYSTEM_ACTION]

    • reason {String}

      The reason received from the platform signaling behind the system action given. [Rel: Skylink.SYSTEM_ACTION_REASON]

    • type {String}

      Protocol step "redirect".


_removePeer

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

Disconnects the Peer connection and remove object references associated.

Triggers:

peerLeft

Parameters:

  • peerId {String}

    The Peer ID to disconnect the connection with.


_removeSDPFirefoxH264Pref

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

Modifies the array of session description received to remove the Firefox 32 H262 preference to prevent breaking connection with nsupported browsers.

Parameters:

  • sdpLines {Array}

    The array of lines in the session description.

Returns:

{Array}:

The updated array of lines in the session description removed of the Firefox 32 H262 preference.


_requestServerInfo

( method ,   url ,   callback ,   params ,   )
private
  Defined in: source/room-init.js:369      Available since 0.5.2

Starts a HTTP /GET REST call to the platform server to retrieve the required connection information.

Parameters:

  • method {String}

    The HTTP method. The value should be provided as "GET".

  • url {String}

    The HTTP URI to invoke the REST call to. The value should be _path.

  • callback {Function}

    The callback fired The callback fired after the HTTP /GET REST call has a response from the platform server.

    • status {Number}

      The HTTP status code of the HTTP response given by the platform server.

    • response {JSON}

      The HTTP response data after the platform server has responded with the HTTP request.

      • success {Boolean}
        The response from the platform server if Application Key connection retrieval is successful and validated or not.
      • pc_constraints {String}
        For success state. The RTCPeerConnection constraints that would be configured in {{#crossLink "Skylink/_room:attribute"}}_room.peerConstraints{{/crossLink}} in {{#crossLink "Skylink/_parseInfo:method"}}_parseInfo(){{/crossLink}}. The data is in JSON stringified string and requires converting the JSON string to an JSON object to use the object.
      • media_constraints {String}
        For success state. The getUserMedia() MediaStreamConstraints that would be configured in {{#crossLink "Skylink/_room:attribute"}}_room.mediaConstraints{{/crossLink}} in {{#crossLink "Skylink/_parseInfo:method"}}_parseInfo(){{/crossLink}}. The data is in JSON stringified string and requires converting the JSON string to an JSON object to use the object.
      • offer_constraints {String}
        For success state. The RTCPeerConnection RTCOfferOptions that would be configured in {{#crossLink "Skylink/_room:attribute"}}_room.offerConstraints{{/crossLink}} in {{#crossLink "Skylink/_parseInfo:method"}}_parseInfo(){{/crossLink}}. The data is in JSON stringified string and requires converting the JSON string to an JSON object to use the object.
      • bandwidth {String}
        For success state. The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String}
        The default audio stream channel for self Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String}
        The default video stream channel for self Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String}
        The default datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
      • cid {String}
        For success state. The Skylink server connection key for the selected room. This would be stored in {{#crossLink "Skylink/_key:attribute"}}_key{{/crossLink}} in {{#crossLink "Skylink/_parseInfo:method"}}_parseInfo(){{/crossLink}}.
      • apiOwner {String}
        For success state. The Skylink server Application Key owner string for the selected room. This would be stored in {{#crossLink "Skylink/_appKeyOwner:attribute"}}_appKeyOwner{{/crossLink}} in {{#crossLink "Skylink/_parseInfo:method"}}_parseInfo(){{/crossLink}}.
      • httpPortList {Array}
        For success state. The list of HTTP ports for reconnection retries. This would be stored in {{#crossLink "Skylink/_socketPorts:attribute"}}_socketPorts.http:{{/crossLink}}.
      • httpPortList.(#index) {Number}
        The HTTP port that Skylink could reattempt to establish for a signaling connection with http: protocol.
      • httpsPortList {Array}
        For success state. The list of HTTPS ports for reconnection retries. This would be stored in {{#crossLink "Skylink/_socketPorts:attribute"}}_socketPorts.https:{{/crossLink}}.
      • httpsPortList.(#index) {Number}
        The HTTPS port that Skylink could reattempt to establish for a signaling connection with https: protocol or when {{#crossLink "Skylink/_forceSSL:attribute"}}_forceSSL{{/crossLink}} is enabled.
      • ipSigserver {String}
        For success state. The platform signaling endpoint URI to open socket connection with. This would be stored in {{#crossLink "Skylink/_signalingServer:attribute"}}_signalingServer{{/crossLink}}.
      • roomCred {String}
        For success state. The generated room token given by the platform server for starting the platform signaling connection. This would be stored in {{#crossLink "Skylink/_room:attribute"}}_room.token{{/crossLink}}.
      • room_key {String}
        For success state. The room ID for identification to the platform signaling connection. This would be stored in {{#crossLink "Skylink/_room:attribute"}}_room.id{{/crossLink}}.
      • start {String}
        For success state. The start datetime stamp (in The startDateTime in [(ISO 8601 format)](https://en.wikipedia.org/wiki/ISO_8601) that the call has started sent by the platform server as an indication for the starting datetime of the platform signaling connection to self. This would be stored in {{#crossLink "Skylink/_room:attribute"}}_room.startDateTime{{/crossLink}}.
      • timeStamp {String}
        For success state. The self session timestamp. This would be stored in {{#crossLink "Skylink/_user:attribute"}}_user.timeStamp{{/crossLink}}
      • userCred {String}
        For success state. The self session access token. This would be stored in {{#crossLink "Skylink/_user:attribute"}}_user.token{{/crossLink}}.
      • username {String}
        For success state. The self session ID. This would be stored in {{#crossLink "Skylink/_user:attribute"}}_user.username{{/crossLink}}.
      • info {String}
        For failure state. The error message thrown by the platform server.
      • error {Number}
        For failure state. The error code of the error thrown by the platform server.
  • params {JSON}

    HTTP Params The HTTP data parameters that would be application/json;charset=UTF-8 encoded when sent to the platform server.


_restartHandler

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

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

Triggers:

handshakeProgress, peerRestart

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • receiveOnly {Boolean} Optional
      DEFAULT: false

      The flag that indicates if the Peer connection would send Stream or not (receive only).

    • enableIceTrickle {Boolean} Optional
      DEFAULT: false

      The flag that indicates if PeerConnections should enable trickling of ICE to connect the ICE connection.

    • enableDataChannel {Boolean} Optional
      DEFAULT: false

      The flag that indicates if Peer connection should have any DataChannel connections.

    • userInfo {JSON}

      The peer information associated with the Peer Connection.

      • userData {String | JSON}
        The custom user data information set by developer. This custom user data can also be set in setUserData().
      • settings {JSON}
        The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.
      • settings.audio {Boolean | JSON} Optional
        DEFAULT: false The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • settings.audio.stereo {Boolean} Optional
        The flag that indicates if stereo should be enabled in the Peer connection Stream audio streaming.
      • settings.video {Boolean | JSON} Optional
        DEFAULT: false The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • settings.video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • settings.video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • settings.video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • settings.video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • settings.video.screenshare {Boolean} Optional
        DEFAULT: false The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • settings.bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • settings.bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • settings.bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • settings.bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
      • mediaStatus {JSON}
        The Peer Stream mute settings for both audio and video streamings.
      • mediaStatus.audioMuted {Boolean} Optional
        DEFAULT: true The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • mediaStatus.videoMuted {Boolean} Optional
        DEFAULT: true The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent.name {String}

      The Peer platform browser or agent name.

    • version {Number}

      The Peer platform browser or agent version.

    • os {Number}

      The Peer platform name.

    • target {String}

      The targeted Peer ID to receive the message object.

    • weight {Number}

      The generated handshake reconnection weight for associated Peer.

    • lastRestart {Number}

      The datetime stamp generated using Date.now() (in ms) used to throttle the Peer reconnection functionality to prevent less Peer reconnection handshaking errors.

    • isConnectionRestart {Boolean}

      The flag that indicates whether the restarting action is caused by ICE connection or handshake connection failure. Currently, this feature works the same as message.explict parameter.

    • explict {Boolean}

      The flag that indicates whether the restart functionality is invoked by the application or by Skylink when the ICE connection fails to establish a "healthy" connection state. Currently, this feature works the same as message.isConnectionRestart parameter.

    • sessionType {String}

      The Peer connection remote Stream streaming session type. If value is "stream", the Stream streaming session is normal user media streaming, else if it is "screensharing", the Stream streaming session is screensharing session.

    • type {String}

      Protocol step "restart".


_restartMCUConnection

( [callback] ,   )
private
  Defined in: source/peer-connection.js:672      Available since 0.6.1

Restarts all Peers connection in a MCU connection environment. This would require the current user to leave the room and restart all current existing Peers connection.

Triggers:

peerRestart, serverPeerRestart, peerJoined, peerLeft, serverPeerJoined

Parameters:

  • callback {Function} Optional

    The callback fired after all targeted Peers connection has been initiated with refresh or have met with an exception. The callback signature is function (error, success).

    • error {JSON}

      The error object received in the callback. If received as null, it means that there is no errors.

      • listOfPeers {Array}
        The list of Peers that the refresh connection had been initiated with.
      • refreshErrors {JSON}
        The list of errors occurred based on per Peer basis.
      • refreshErrors.(#peerId) {Object | String}
        The Peer ID associated with the error that occurred when refreshing the connection.
    • success {JSON}

      The success object received in the callback. If received as null, it means that there are errors.

      • listOfPeers {Array}
        The list of Peers that the refresh connection had been initiated with.

_restartPeerConnection

( peerId ,   isSelfInitiatedRestart ,   isConnectionRestart ,   callback ,   [explict=false] ,   )
private
  Defined in: source/peer-connection.js:159      Available since 0.5.8

Restarts a Peer connection in a P2P environment. This is usually done for replacing the previous Stream attached and restarting the connection with a new one, or when the ICE connection has issues streaming video/audio stream in the remote Stream which requires a refresh in the ICE connection.

Parameters:

  • peerId {String}

    The Peer ID to restart the connection with.

  • isSelfInitiatedRestart {Boolean}

    The flag that indicates if the restart action was caused by self.

  • isConnectionRestart {Boolean}

    The flag that indicates whether the restarting action is caused by ICE connection or handshake connection failure. Currently, this feature works the same as explict parameter.

  • callback {Function}

    The callback fired after the Peer connection has been succesfully initiated with a restart. Set this value to null if you do not want to pass in any callbacks.

  • explict {Boolean} Optional
    DEFAULT: false

    The flag that indicates whether the restart functionality is invoked by the application or by Skylink when the ICE connection fails to establish a "healthy" connection state. Currently, this feature works the same as isConnectionRestart parameter.


_roomLockEventHandler

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

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

Triggers:

roomLock

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • lock {String}

      The flag that indicates if the currently joined room is locked.

    • type {String}

      Protocol step "roomLockEvent".


_sendBlobDataToPeer

( data ,   dataInfo ,   [targetPeerId=null] ,   )
private
  Defined in: source/data-transfer.js:316      Available since 0.5.5

Starts a data transfer with a Peer. If multi-transfer is supported, Skylink would open a new DataChannel connection with Peer to start data transfer. If mutli-transfer is not supported in _INTEROP_MULTI_TRANSFERS, the data transfer would start in the DATA_CHANNEL_TYPE.MESSAGING channel instead.

Parameters:

  • data {Blob}

    The Blob data object to send.

  • dataInfo {JSON}

    The data transfer information.

    • transferId {String}

      The transfer ID of the data transfer.

    • name {String}

      The transfer Blob data object name.

    • timeout {Number} Optional
      DEFAULT: 60

      The timeout set to await in seconds for response from DataChannel connection.

    • size {Number}

      The Blob data binary size expected to be received in the receiving end.

    • isPrivate {Boolean} Optional
      DEFAULT: false

      The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.

  • targetPeerId {String | Array} Optional
    DEFAULT: null

    The receiving Peer ID. Array is used for MCU connection where multi-targeted Peers are used. By default, the value is null, which indicates that the data transfer is requested with all connected Peers.

Returns:

{String}:

The DataChannel connection ID associated with the transfer. If returned as null or empty, it indicates an error.


_sendChannelMessage

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

Sends socket message over the platform signaling socket connection.

Parameters:

  • message {JSON}

    The socket message object.

    • type {String}

      Required. Protocol type of the socket message object.


_sendDataChannelMessage

( peerId ,   data ,   [channelName="main"] ,   )
private
  Defined in: source/data-channel.js:266      Available since 0.5.2

Sends data over the DataChannel connection associated with the Peer connection. The current supported data type is string. Blob, ArrayBuffer types support is not yet currently handled or implemented.

Triggers:

dataChannelState

Parameters:

  • peerId {String}

    The Peer ID to send the data to the associated DataChannel connection.

  • data {JSON | String}

    The data to send over. string is only used to send binary data string over. JSON is primarily used for the DT Protocol that Skylink follows for P2P messaging and transfers.

  • channelName {String} Optional
    DEFAULT: "main"

    The DataChannel channelName of the connection to send the data over to. The datachannel to send messages to. By default, if the DataChannel channelName is not provided, the DataChannel connection associated with the channelName "main" would be used.


_setDataChannelTimeout

( peerId ,   timeout ,   [isSender=false] ,   channelName ,   )
private
  Defined in: source/data-transfer.js:240      Available since 0.5.0

Sets a waiting timeout for every response sent to DataChannel connection receiving end. Once the timeout has ended, a timeout error will be thrown and data transfer will be terminated.

Parameters:

  • peerId {String}

    The Peer ID associated with the DataChannel connection.

  • timeout {Number}

    The waiting timeout in seconds.

  • isSender {Boolean} Optional
    DEFAULT: false

    The flag thats indicates if the response is related to a downloading or uploading data transfer.

  • channelName {String}

    The DataChannel connection ID.


_setIceServers

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

Reconfigures the RTCConfiguration.iceServers that is to be passed in constructing the new RTCPeerConnection object to remove (disable) STUN or remove TURN (disable) server connections based on the init() configuration passed in.

Parameters:

  • config {JSON}

    The RTCConfiguration that is to be passed for constructing the new RTCPeerConnection object.

Returns:

{JSON}:

The updated RTCConfiguration object based on the configuration settings in the init() method.


_setLocalAndSendMessage

( targetMid ,   sessionDescription ,   )
private
  Defined in: source/peer-handshake.js:315      Available since 0.5.2

Sets the WebRTC handshake layer session description into the Peer RTCPeerConnection object RTCPeerConnection.setLocalDescription() associated with the Peer connection.

Triggers:

handshakeProgress

Parameters:

  • targetMid {String}

    The Peer ID to send the session description to after setting into the associated RTCPeerConnection object.

  • sessionDescription {JSON}

    The OFFER or an ANSWER session description to set to the associated Peer after setting into the RTCPeerConnection object.


_setSDPAudioCodec

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

Modifies the array of session description received to configure the selected audio codec to use in the audio streaming connection.

Parameters:

  • sdpLines {Array}

    The array of lines in the session description.

Returns:

{Array}:

The updated array of lines in the session description with the selected audio codec.


_setSDPBitrate

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

Modifies the array of session description received to set a custom bandwidth bitrate (in kbps) in the streaming connection. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate.

Parameters:

  • sdpLines {Array}

    The array of lines in the session description.

Returns:

{Array}:

The updated array of lines in the session description with custom bandwidth bitrate (in kbps) settings.


_setSDPVideoCodec

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

Modifies the array of session description received to configure the selected video codec to use in the video streaming connection.

Parameters:

  • sdpLines {Array}

    The array of lines in the session description.

Returns:

{Array}:

The updated array of lines in the session description with the selected video codec.


_setSDPVideoResolution

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

BROKEN (not in use). Modifies the array of session description received to set a custom video resolution in the video streaming connection.

Parameters:

  • sdpLines {Array}

    The array of lines in the session description.

Returns:

{Array}:

The updated array of lines in the session description with the custom video resolution.


_startDataTransfer

( data ,   dataInfo ,   [listOfPeers] ,   [callback] ,   )
private
  Defined in: source/data-transfer.js:1502      Available since 0.6.1

Starts the actual data transfers with the array of Peers provided and based on the data transfer type to start the DataChannel connection data transfer.

Parameters:

  • data {Blob | String}

    The transfer data object.

  • dataInfo {JSON}

    The transfer data object information.

    • name {String} Optional
      DEFAULT: transferId

      The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.

    • size {Number}

      The transfer data size.

    • transferId {String}

      The data transfer ID.

    • dataType {String}

      The type of data transfer initiated. Available types are "dataURL" and "blob".

    • timeout {String}

      The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.

    • isPrivate {Boolean}

      The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.

  • listOfPeers {Array} Optional

    The array of targeted Peer to transfer the data object to.

  • callback {Function} Optional

    The callback fired after all the data transfers is completed successfully or met with an exception. The callback signature is function (error, success).

    • error {JSON}

      The error object received in the callback. If received as null, it means that there is no errors.

      • state {String} Optional
        DEFAULT: null Deprecated. The dataTransferState when the error has occurred. This only triggers for a single targeted Peer data transfer.
      • error {Object | String} Optional
        DEFAULT: null Deprecated. The error received when the data transfer fails. This only triggers for single targeted Peer data transfer.
      • transferId {String}
        The transfer ID of the failed data transfer.
      • peerId {String} Optional
        DEFAULT: null The single targeted Peer ID for the data transfer. This only triggers for single targeted Peer data transfer.
      • listOfPeers {Array}
        The list of Peer that the data transfer has been initiated with.
      • isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
      • transferErrors {JSON}
        The list of errors occurred based on per Peer basis.
      • transferErrors.(#peerId) {Object | String}
        The error that occurred when having a DataChannel connection data transfer with associated Peer.
      • transferInfo {JSON}
        The transfer data object information.
      • transferInfo.name {String} Optional
        DEFAULT: transferId The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.
      • transferInfo.size {Number}
        The transfer data size.
      • transferInfo.transferId {String}
        The data transfer ID.
      • transferInfo.dataType {String}
        The type of data transfer initiated. The received type would be "blob".
      • transferInfo.timeout {String}
        The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
      • transferInfo.isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
    • success {JSON}

      The success object received in the callback. If received as null, it means that there are errors.

      • state {String} Optional
        DEFAULT: null Deprecated. The dataTransferState when the data transfer has been completed successfully. This only triggers for a single targeted Peer data transfer.
      • transferId {String}
        The transfer ID of the successful data transfer.
      • peerId {String} Optional
        DEFAULT: null The single targeted Peer ID for the data transfer. This only triggers for single targeted Peer data transfer.
      • listOfPeers {Array}
        The list of Peer that the data transfer has been initiated with.
      • isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
      • transferInfo {JSON}
        The transfer data object information.
      • transferInfo.name {String} Optional
        DEFAULT: transferId The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.
      • transferInfo.size {Number}
        The transfer data size.
      • transferInfo.transferId {String}
        The data transfer ID.
      • transferInfo.dataType {String}
        The type of data transfer initiated. The received type would be "blob".
      • transferInfo.timeout {String}
        The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
      • transferInfo.isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.

_startPeerConnectionHealthCheck

( peerId ,   [toOffer=false] ,   )
private
  Defined in: source/peer-handshake.js:225      Available since 0.5.5

Starts the waiting timeout for a "healthy" connection with associated Peer connection. It waits for any existing Peer "healthy" state in successful _peerConnectionHealth. If timeout has reached it's limit and does not have any "healthy" connection state with Peer connection, it will restart the connection again with _restartPeerConnection(). This sets the timeout object associated with the Peer into Skylink/_peerConnectionHealthTimers.

Parameters:

  • peerId {String}

    The Peer ID to start a waiting timeout for a "healthy" connection.

  • toOffer {Boolean} Optional
    DEFAULT: false

    The flag that indicates if Peer connection is an offerer or an answerer for an accurate timeout waiting time.


_stopPeerConnectionHealthCheck

( peerId ,   )
private
  Defined in: source/peer-handshake.js:288      Available since 0.5.5

Stops the waiting timeout for a "healthy" connection associated with the Peer.

Parameters:

  • peerId {String}

    The Peer ID to stop a waiting timeout for a "healthy" connection.


_streamEventHandler

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

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

Triggers:

streamEnded

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • status {String}

      The Peer connection remote Stream streaming current status.

      • ended: The Peer connection remote Stream streaming has ended
    • cid {String}

      The Skylink server connection key for the selected room.

    • sessionType {String}

      The Peer connection remote Stream streaming session type. If value is "stream", the Stream streaming session is normal user media streaming, else if it is "screensharing", the Stream streaming session is screensharing session.

    • type {String}

      Protocol step "stream".


_throttle

( func ,   wait ,   )
private
  Defined in: source/skylink-events.js:1459      Available since 0.5.8

Returns a wrapper of the original function, which fires only once during a specified amount of time.

Parameters:

  • func {Function}

    The function that should be throttled.

  • wait {Number}

    The amount of time that function need to throttled (in ms).

Returns:

{Function}:

The throttled function.


_trigger

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

Triggers event subscription handlers that is associated with the event name. on() event subscription handlers will be triggered always, but once() event subscription hadlers will only be triggered once the condition is met.

Parameters:

  • eventName {String}

    The Skylink event name to trigger that would trigger event subscription handlers associated to the event name with the arguments parameters payload.


_updateUserEventHandler

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

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

Triggers:

peerUpdated

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • userData {JSON | String}

      The updated Peer information custom user data.

    • type {String}

      Protocol step "updateUserEvent".


_wait

( callback ,   condition ,   [intervalTime=50] ,   )
private
  Defined in: source/skylink-events.js:1409      Available since 0.5.5

Starts the interval check for the condition provided to meet before clearing the interval and triggering the callback provided. This utilises setInterval() function.

Parameters:

  • callback {Function}

    The callback fired after the condition provided has been met.

  • condition {Function}

    The condition function that once the condition has been met, trigger the callback. Return in the condition function true to pass as meeting the condition.

  • intervalTime {Number} Optional
    DEFAULT: 50

    The interval loop timeout that the interval check should iterate based on the timeout provided (in ms). By default, if the value is not configured, it is 50ms.


_waitForLocalMediaStream

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

Waits for self MediaStream object to be attached to Skylink based on the options provided before firing the callback to indicate that self Stream object is received. This will stop any currently attached Stream object to Skylink.

Triggers:

mediaAccessSuccess, mediaAccessError, mediaAccessRequired

Parameters:

  • callback {Function}

    The callback fired after self MediaStream object is attached to Skylink based on the options provided.

    • error {Object} Optional
      DEFAULT: null

      The callback error that is defined when there's an error.

  • callback {Function}

    The callback fired after self MediaStream object is attached to Skylink based on the options provided successfully or met with an exception. The callback signature is function (error).

    • {Object}

      The error object received in the callback. If received as undefined, it means that there is no errors.

  • options {JSON} Optional

    The self Stream streaming settings. If both audio and video option is false, there should be no audio and video stream sending from self connection.

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream audio user media access is given.

      • stereo {Boolean} Optional
        DEFAULT: false The flag that indicates if stereo should be enabled in self connection Stream audio streaming.
      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object audio streaming is muted.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming video settings. If false, it means that video streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream video user media access is given.

      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object video streaming is muted.
      • resolution {JSON} Optional
        The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Number} Optional
        The self Stream streaming video resolution width.
      • resolution.height {Number} Optional
        The self Stream streaming video resolution height.
      • frameRate {Number} Optional
        DEFAULT: 50 The self Stream streaming video maximum frameRate.
    • bandwidth {String} Optional

      The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.

      • audio {String} Optional
        The configured audio stream channel for the self Stream object bandwidth that audio streaming should use in kb/s.
      • video {String} Optional
        The configured video stream channel for the self Stream object bandwidth that video streaming should use in kb/s.
      • data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.

_waitForOpenChannel

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

Waits for the signaling socket channel connection to be ready before starting the room connection with the Skylink signaling platform.

Triggers:

peerJoined, incomingStream, mediaAccessRequired

Parameters:

  • options {JSON} Optional

    The connection settings for self connection in the room. If both audio and video option is false, there should be no audio and video stream sending from self connection.

    • userData {String | JSON} Optional

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream audio user media access is given.

      • stereo {Boolean} Optional
        The flag that indicates if stereo should be enabled in self connection Stream audio streaming.
      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object audio streaming is muted.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming video settings. If false, it means that video streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream video user media access is given.

      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object video streaming is muted.
      • resolution {JSON} Optional
        The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Number} Optional
        The self Stream streaming video resolution width.
      • resolution.height {Number} Optional
        The self Stream streaming video resolution height.
      • frameRate {Number} Optional
        DEFAULT: 50 The self Stream streaming video maximum frameRate.
    • bandwidth {String} Optional

      The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.

      • audio {String} Optional
        DEFAULT: 50 The configured audio stream channel for the self Stream object bandwidth that audio streaming should use in kb/s.
      • video {String} Optional
        DEFAULT: 256 The configured video stream channel for the self Stream object bandwidth that video streaming should use in kb/s.
      • data {String} Optional
        DEFAULT: 1638400 The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • manualGetUserMedia {Boolean} Optional

      The flag that indicates if joinRoom() should not invoke getUserMedia() automatically but allow the developer's application to invoke getUserMedia() manually in the application. When user media access is required, the event mediaAccessRequired will be triggered.

  • callback {Function}

    The callback fired after signaling socket channel connection has opened successfully with relevant user media being available according to the settings or met with an exception. The callback signature is function (error).

    • error {Object}

      The error object received in the callback. If received as undefined, it means that there is no errors.


_welcomeHandler

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

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

Triggers:

handshakeProgress, peerJoined

Parameters:

  • message {JSON}

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

    • rid {String}

      The room ID for identification to the platform signaling connection.

    • mid {String}

      The Peer ID associated with this message.

    • receiveOnly {Boolean} Optional
      DEFAULT: false

      The flag that indicates if the Peer connection would send Stream or not (receive only).

    • enableIceTrickle {Boolean} Optional
      DEFAULT: false

      The flag that indicates if PeerConnections should enable trickling of ICE to connect the ICE connection.

    • enableDataChannel {Boolean} Optional
      DEFAULT: false

      The flag that indicates if Peer connection should have any DataChannel connections.

    • userInfo.userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • userInfo.settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

    • userInfo.settings.audio {Boolean | JSON} Optional
      DEFAULT: false

      The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.

    • userInfo.settings.audio.stereo {Boolean} Optional

      The flag that indicates if stereo should be enabled in the Peer connection Stream audio streaming.

    • userInfo.settings.video {Boolean | JSON} Optional
      DEFAULT: false

      The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.

    • userInfo.settings.video.resolution {JSON} Optional

      The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]

    • userInfo.settings.video.resolution.width {Number} Optional

      The Peer Stream streaming video resolution width.

    • userInfo.settings.video.resolution.height {Number} Optional

      The Peer Stream streaming video resolution height.

    • userInfo.settings.video.frameRate {Number} Optional

      The Peer Stream streaming video maximum frameRate.

    • userInfo.settings.video.screenshare {Boolean} Optional
      DEFAULT: false

      The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.

    • userInfo.settings.bandwidth {String} Optional

      The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.

    • userInfo.settings.bandwidth.audio {String} Optional

      The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.

    • userInfo.settings.bandwidth.video {String} Optional

      The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.

    • userInfo.settings.bandwidth.data {String} Optional

      The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.

    • userInfo.mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

    • userInfo.mediaStatus.audioMuted {Boolean} Optional
      DEFAULT: true

      The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.

    • userInfo.mediaStatus.videoMuted {Boolean} Optional
      DEFAULT: true

      The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.

    • agent.name {String}

      The Peer platform browser or agent name.

    • version {Number}

      The Peer platform browser or agent version.

    • os {Number}

      The Peer platform name.

    • type {String}

      Protocol step "enter".

    • target {String}

      The targeted Peer ID to receive the message object.

    • weight {Number}

      The generated handshake connection weight for associated Peer.

    • sessionType {String}

      The Peer connection remote Stream streaming session type. If value is "stream", the Stream streaming session is normal user media streaming, else if it is "screensharing", the Stream streaming session is screensharing session.

    • type {String}

      Protocol step "welcome".


_WRQProtocolHandler

( senderPeerId ,   data ,   channelName ,   )
private
  Defined in: source/data-transfer.js:623      Available since 0.5.2

Handles the WRQ Protocol request received from the DataChannel connection.

Triggers:

dataTransferState

Parameters:

  • senderPeerId {String}

    The Peer ID associated with the DataChannel connection.

  • data {JSON}

    The data object received from the DataChannel connection. This should contain the WRQ payload.

    • agent {String}

      The sender Peer platform browser or agent name.

    • version {Number}

      The sender Peer platform browser or agent version.

    • name {String}

      The transfer data object name.

    • size {Number}

      The transfer data object expected received size.

    • chunkSize {Number}

      The expected data transfer packet (chunk) size.

    • timeout {Number}

      The timeout set to await in seconds for response from DataChannel connection.

    • isPrivate {Boolean}

      The flag to indicate if the data transfer is a private transfer to the Peer connection directly and not broadcasted to all Peers conneciton.

    • sender {String}

      The Peer ID of the sender.

    • type {String}

      Protocol step "WRQ".

  • channelName {String}

    The DataChannel connection ID associated with the transfer.


acceptDataTransfer

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

Responds to a data transfer request by rejecting or accepting the data transfer request initiated by a Peer.

Triggers:

incomingData, dataTransferState

Parameters:

  • peerId {String}

    The sender Peer ID.

  • transferId {String}

    The data transfer ID of the data transfer request to accept or reject.

  • accept {Boolean} Optional
    DEFAULT: false

    The flag that indicates true as a response to accept the data transfer and false as a response to reject the data transfer request.


cancelBlobTransfer

( peerId ,   transferId ,   )
deprecated
Deprecated: Use .cancelDataTransfer()
  Defined in: source/data-transfer.js:1935      Available since 0.5.7

Terminates an ongoing DataChannel connection data transfer.

Triggers:

dataTransferState

Parameters:

  • peerId {String}

    The Peer ID associated with the data transfer.

  • transferId {String}

    The data transfer ID of the data transfer request to terminate the request.


cancelDataTransfer

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

Terminates an ongoing DataChannel connection data transfer.

Triggers:

dataTransferState

Parameters:

  • peerId {String}

    The Peer ID associated with the data transfer.

  • transferId {String}

    The data transfer ID of the data transfer request to terminate the request.


disableAudio

()
deprecated
Deprecated: Use .muteStream()
  Defined in: source/stream-media.js:1933      Available since 0.5.5

Mutes the currently attached Stream object audio stream.

Triggers:

streamMuted, peerUpdated

Example:

        

SkylinkDemo.disableAudio();


disableVideo

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

Mutes the currently attached Stream object video stream.

Triggers:

streamMuted, peerUpdated

Example:

        

SkylinkDemo.disableVideo();


enableAudio

()
deprecated
Deprecated: Use .muteStream()
  Defined in: source/stream-media.js:1915      Available since 0.5.5

Unmutes the currently attached Stream object audio stream.

Triggers:

streamMuted, peerUpdated

Example:

        

SkylinkDemo.enableAudio();


enableVideo

()
deprecated
Deprecated: Use .muteStream()
  Defined in: source/stream-media.js:1951      Available since 0.5.5

Unmutes the currently attached Stream object video stream.

Triggers:

streamMuted, peerUpdated

Example:

        

SkylinkDemo.enableVideo();


generateUUID

()
  Defined in: source/template/header.js:176      Available since 0.5.9

Helper function that generates an Unique ID (UUID) string.

Returns:

{String}:

Generated Unique ID (UUID) string.

Example:

        

// Get Unique ID (UUID) var uuid = SkylinkDemo.generateUUID();


getPeerInfo

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

Gets the Peer information. If an invalid Peer ID is provided, or no Peer ID is provided, the method will return the self peer information.

Parameters:

  • peerId {String} Optional

    The Peer information to retrieve the data from. If the Peer ID is not provided, it will return the self Peer information.

Returns:

{JSON}:

The Peer information. The parameters relates to the peerInfo payload given in the peerJoined event.

Example:

        

// Example 1: To get other peer's information var peerInfo = SkylinkDemo.getPeerInfo(peerId);

// Example 2: To get own information var userInfo = SkylinkDemo.getPeerInfo();


getPeers

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

Retrieves the list of rooms and peers under the same realm based on the Application Key configured in init() from the platform signaling. This will only work if self is a privileged Peer.

Triggers:

getPeersStateChange

Parameters:

  • showAll {Boolean} Optional
    DEFAULT: false

    The flag that indicates if returned list should also include privileged peers in the list. By default, the value is false.

  • callback {Function} Optional

    The callback fired after the receiving the current list of Peers from platform signaling or have met with an exception. The callback signature is function (error, success).

    • error {Object}

      The error object received in the callback. This is the exception thrown that caused the failure for getting self user media. If received as null, it means that there is no errors.

    • success {JSON}

      The success object received in the callback. If received as null, it means that there are errors.

Example:

        

// To get list of unprivileged peers only SkylinkDemo.getPeers();

// To get list of all peers, including other privileged peers SkylinkDemo.getPeers(true);

// To get a list of unprivileged peers then invoke the callback SkylinkDemo.getPeers(function(error, success){ if (error){ console.log("Error happened. Can not retrieve list of peers"); } else{ console.log("Success fully retrieved list of peers", success); } });

// To get a list of all peers then invoke the callback SkylinkDemo.getPeers(true, function(error, success){ if (error){ console.log("Error happened. Can not retrieve list of peers"); } else{ console.log("Success fully retrieved list of peers", success); } });


getUserData

()
  Defined in: source/peer-data.js:152      Available since 0.5.10

Gets the current custom user data information for self. You may set the current customer user data information for self in setUserData().

Returns:

{JSON | String}:

The custom (or updated) user data information for self set.

Example:

        

// Example 1: To get other peer's userData var peerData = SkylinkDemo.getUserData(peerId);

// Example 2: To get own userData var userData = SkylinkDemo.getUserData();


getUserMedia

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

Gets self user media Stream object to attach to Skylink. Do not invoke this function when user has already joined a room as this may affect any currently attached stream. You may use sendStream() instead if self is already in the room, and allows application to attach application own MediaStream object to Skylink.

Triggers:

mediaAccessSuccess, mediaAccessError

Parameters:

  • options {JSON} Optional

    The self Stream streaming settings for the new Stream object attached to Skylink. If this parameter is not provided, the options value would be { audio: true, video: true }.

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream audio user media access is given.

      • stereo {Boolean} Optional
        DEFAULT: false The flag that indicates if stereo should be enabled in self connection Stream audio streaming.
      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object audio streaming is muted.
      • optional {Array} Optional
        The optional constraints for audio streaming in self user media Stream object. This follows the optional setting in the MediaStreamConstraints when getUserMedia() is invoked. Tampering this may cause errors in retrieval of self user media Stream object. Refer to this [site for more reference](http://www.sitepoint.com/introduction-getusermedia-api/).
    • video {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming video settings. If false, it means that video streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream video user media access is given.

      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object video streaming is muted.
      • resolution {JSON} Optional
        The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Number} Optional
        The self Stream streaming video resolution width. This sets the maxWidth of the video constraints passed in getUserMedia().
      • resolution.height {Number} Optional
        The self Stream streaming video resolution height. This sets the maxHeight of the video constraints passed in getUserMedia().
      • frameRate {Number} Optional
        DEFAULT: 50 The self Stream streaming video maximum frameRate. This sets the maxFramerate of the video constraints passed in getUserMedia().
      • optional {Array} Optional
        The optional constraints for video streaming in self user media Stream object. This follows the optional setting in the MediaStreamConstraints when getUserMedia() is invoked. Tampering this may cause errors in retrieval of self user media Stream object. Refer to this [site for more reference](http://www.sitepoint.com/introduction-getusermedia-api/).
  • callback {Function} Optional

    The callback fired after Skylink has gained access to self media stream and attached it successfully with the provided media settings or have met with an exception. The callback signature is function (error, success).

    • error {Object}

      The error object received in the callback. This is the exception thrown that caused the failure for getting self user media. If received as null, it means that there is no errors.

    • success {Object}

      The success object received in the callback. The self user media MediaStream object. To display the MediaStream object to a video or audio, simply invoke:
      attachMediaStream(domElement, stream);. If received as null, it means that there are errors.

Example:

        

// Default is to get both audio and video // Example 1: Get both audio and video by default. SkylinkDemo.getUserMedia();

// Example 2: Get the audio stream only SkylinkDemo.getUserMedia({ video: false, audio: true });

// Example 3: Set the stream settings for the audio and video SkylinkDemo.getUserMedia({ video: { resolution: SkylinkDemo.VIDEO_RESOLUTION.HD, frameRate: 50 }, audio: { stereo: true } });

// Example 4: Get user media with callback SkylinkDemo.getUserMedia({ video: false, audio: true },function(error,success){ if (error){ console.log(error); } else{ console.log(success); } });


init

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

Initialises and configures Skylink to begin any connection. NOTE that this is the first method that has to be called before using any other functionalities other than debugging features like setLogLevel() and setDebugMode() and after all event subscriptions like on() or once() has been made. This is where the Application Key is configured and attached to Skylink for usage.

Triggers:

readyStateChange

Parameters:

  • options {String | JSON}

    The configuration settings for Skylink. If provided options is a typeof string, it will be interpreted as the Application Key being provided.

    • appKey {String}

      Previously known as apiKey. The Application Key that Skylink uses for initialising and connecting rooms.

    • defaultRoom {String} Optional
      DEFAULT: options.appKey

      The default room that Skylink should connect to if there is no room provided in joinRoom(). If this value is not provided, the default room value would be the Application Key provided.

    • roomServer {String} Optional

      The platform server URL that Skylink makes a HTTP /GET to retrieve the connection information required. This is a debugging feature, and it's not advisable to manipulate this value unless you are using a beta platform server.

    • region {String} Optional

      Deprecated feature. The regional server that Skylink should connect to for fastest connectivity. [Rel: Skylink.REGIONAL_SERVER]

    • enableIceTrickle {Boolean} Optional
      DEFAULT: true

      Debugging Feature. The flag that indicates if PeerConnections should enable trickling of ICE to connect the ICE connection. Configuring this value to false may result in a slower connection but a more stable connection.

    • enableDataChannel {Boolean} Optional
      DEFAULT: true

      Debugging feature. The flag that indicates if PeerConnections should have any DataChannel connections. Configuring this value to false may result in failure to use features like sendBlobData(), sendP2PMessage() and sendURLData() or any DataChannel connection related services.

    • enableTURNServer {Boolean} Optional
      DEFAULT: true

      Debugging feature. The flag that indicates if PeerConnections connection should use any TURN server connection. Tampering this flag may disable any successful Peer connection that is behind any firewalls, so set this value at your own risk.

    • enableSTUNServer {Boolean} Optional
      DEFAULT: true

      Debugging feature. The flag that indicates if PeerConnections connection should use any STUN server connection. Tampering this flag may cause issues to connections, so set this value at your own risk.

    • forceTURN {Boolean} Optional
      DEFAULT: false

      The flag that indicates if PeerConnections connection should only use TURN server connection which enables a quicker connectivity. This configuration will override the settings for enableTURNServer and enableSTUNServer and set enableTURNServer as true and enableSTUNServer as false if the value is set to true.

    • usePublicSTUN {Boolean} Optional
      DEFAULT: true

      The flag that indicates if PeerConnections connection should enable usage of public STUN server connection connectivity. This configuration would not work if enableSTUNServer is set to false or forceTURN is set to true.

    • TURNServerTransport {Boolean} Optional
      DEFAULT: Skylink.TURN_TRANSPORT.ANY

      Debugging feature. The TURN server transport to enable for TURN server connections. Tampering this flag may cause issues to connections, so set this value at your own risk. [Rel: Skylink.TURN_TRANSPORT]

    • credentials {JSON} Optional

      The credentials configured for starting a new persistent room meeting or connecting with Application Keys that do not use CORS authentication. Setting the startDateTime or the duration will not affect the actual duration for non persistent rooms. This feature would only affect connections with Application Keys that is configured for persistent room feature. To enable persistent room or disable CORS, you may set it in the developer console. CORS may be disabled by setting the platform to "Other".

      • startDateTime {String}
        The room start datetime stamp in ISO 8601 format. This will start a new meeting based on the starting datetime stamp in the room that was selected to join for Application Key that is configured with persistent room feature. You may use Date.toISOString() to retrieve ISO 8601 formatted date time stamp. The start date time of the room will not affect non persistent room connection.
      • duration {Number}
        The duration (in hours) that the room duration should be in. This will set the duration starting from the provided startDateTime onwards and after the duration is over, the meeting is over and the room is closed for Application Key that is configured with persistent room feature. The duration will not affect non persistent room connection.The duration of the meeting in hours.
        E.g. 0.5 for half an hour, 1.4 for 1 hour and 24 minutes
      • credentials {String}
        The room credentials for Application Key. This is required for rooms connecting without CORS verification or starting a new persistent room meeting.

        To generate the credentials:
        1. Concatenate a string that consists of the room name the room meeting duration (in hours) and the start date timestamp (in ISO 8601 format).
          Format room + "_" + duration + "_" + startDateTimeStamp
        2. Hash the concatenated string with the Application Key token using SHA-1. You may use the CryptoJS.HmacSHA1 function to do so.
          Example var hash = CryptoJS.HmacSHA1(concatenatedString, token);
        3. Convert the hash to a Base64 encoded string. You may use the CryptoJS.enc.Base64 function to do so.
          Example var base64String = hash.toString(CryptoJS.enc.Base64);
        4. Encode the Base64 encoded string to a URI component using UTF-8 encoding with encodeURIComponent().
          Example var credentials = encodeURIComponent(base64String);

    • audioFallback {Boolean} Optional
      DEFAULT: false

      The flag that indicates if there is a failure in getUserMedia() in retrieving user media video stream, it should fallback to retrieve audio stream only. This would not work for joinRoom() except getUserMedia().

    • forceSSL {Boolean} Optional
      DEFAULT: false

      The flag to enforce an SSL platform signaling and platform server connection. If self domain accessing protocol is https:, SSL connections would be automatically used. This flag is mostly used for self domain accessing protocol that is http: and enforcing the SSL connections for platform signaling and platform server connection.

    • audioCodec {String} Optional
      DEFAULT: Skylink.AUDIO_CODEC.AUTO

      Debugging Feature. The preferred audio codec that Peer connection streaming audio codec should use in the connection when available. If not available, the default codec would be the browser generated session description selected codec. [Rel: Skylink.AUDIO_CODEC]

    • videoCodec {String} Optional
      DEFAULT: Skylink.VIDEO_CODEC.AUTO

      Debugging Feature. The preferred video codec that Peer connection streaming video codec should use in the connection when available. If not available, the default codec would be the browser generated session description selected codec. [Rel: Skylink.VIDEO_CODEC]

    • socketTimeout {Number} Optional
      DEFAULT: 20000

      The timeout that the socket connection should throw a timeout exception when socket fails to receive a response from connection. Depending on the max retries left based on the availability of ports given by the platform server, the socket will reattempt to establish a socket connection with the signaling server.
      The mininum timeout value is 5000.

    • forceTURNSSL {Boolean} Optional
      DEFAULT: false

      The flag to enforce an SSL TURN server connection. If self domain accessing protocol is https:, SSL connections would be automatically used. This flag is mostly used for self domain accessing protocol that is http: and enforcing the SSL connections for TURN server connection. This will configure TURN server connection using port 443 only and if turns: protocol is supported, it will use turns: protocol.

  • callback {Function} Optional

    The callback fired after Skylink has been initialised successfully or have met with an exception. The callback signature is function (error, success).

    • error {JSON}

      The error object received in the callback. If received as null, it means that there is no errors.

      • errorCode {Number}
        The READY_STATE_CHANGE_ERROR if there is an readyStateChange event error that caused the failure for initialising Skylink. [Rel: Skylink.READY_STATE_CHANGE_ERROR]
      • error {Object}
        The exception thrown that caused the failure for initialising Skylink.
      • status {Number}
        The XMLHttpRequest status code received when exception is thrown that caused the failure for initialising Skylink.
    • success {JSON}

      The success object received in the callback. If received as null, it means that there are errors.

      • appKey {String}
        Previously known as apiKey. The Application Key that Skylink uses for initialising and connecting rooms.
      • defaultRoom {String}
        The default room that Skylink should connect to if there is no room provided in joinRoom().
      • roomServer {String}
        The platform server URL that Skylink makes a HTTP /GET to retrieve the connection information required.
      • enableIceTrickle {Boolean}
        The flag that indicates if PeerConnections should enable trickling of ICE to connect the ICE connection.
      • enableDataChannel {Boolean}
        The flag that indicates if PeerConnections should have any DataChannel connections.
      • enableTURNServer {Boolean}
        The flag that indicates if PeerConnections connection should use any TURN server connection.
      • enableSTUNServer {Boolean}
        The flag that indicates if PeerConnections connection should use any STUN server connection.
      • TURNServerTransport {Boolean}
        The TURN server transport to enable for TURN server connections. [Rel: Skylink.TURN_TRANSPORT]
      • serverRegion {String} Optional
        The regional server that Skylink should connect to for fastest connectivity. [Rel: Skylink.REGIONAL_SERVER]
      • audioFallback {Boolean}
        The flag that indicates if there is a failure in getUserMedia() in retrieving user media video stream, it should fallback to retrieve audio stream only.
      • forceSSL {Boolean}
        The flag to enforce an SSL platform signaling and platform server connection. If self domain accessing protocol is https:, SSL connections would be automatically used.
      • audioCodec {String}
        The preferred audio codec that Peer connection streaming audio codec should use in the connection when available. [Rel: Skylink.AUDIO_CODEC]
      • videoCodec {String}
        The preferred video codec that Peer connection streaming video codec should use in the connection when available. [Rel: Skylink.VIDEO_CODEC]
      • socketTimeout {Number}
        The timeout that the socket connection should throw a timeout exception when socket fails to receive a response from connection. Depending on the max retries left based on the availability of ports given by the platform server, the socket will reattempt to establish a socket connection with the signaling server.
      • forceTURNSSL {Boolean}
        The flag to enforce an SSL TURN server connection. If self domain accessing protocol is https:, SSL connections would be automatically used. This will configure TURN server connection using port 443 only and if turns: protocol is supported, it will use turns: protocol.
      • forceTURN {Boolean}
        The flag that indicates if PeerConnections connection should only use TURN server connection which enables a quicker connectivity. This configuration will override the settings for enableTURNServer and enableSTUNServer and set enableTURNServer as true and enableSTUNServer as false if the value is set to true.
      • usePublicSTUN {Boolean}
        The flag that indicates if PeerConnections connection should enable usage of public STUN server connection connectivity. This configuration would not work if enableSTUNServer is set to false or forceTURN is set to true.

Example:

        

// Note: Default room is appKey when no room // Example 1: To initalize without setting any default room. SkylinkDemo.init("YOUR_APP_KEY_HERE");

// Example 2: To initialize with appKey and defaultRoom SkylinkDemo.init({ appKey: "YOUR_APP_KEY_HERE", defaultRoom: "mainHangout" });

// Example 3: To initialize with credentials to set startDateTime and // duration of the room var hash = CryptoJS.HmacSHA1(roomname + "" + duration + "" + (new Date()).toISOString(), token); var credentials = encodeURIComponent(hash.toString(CryptoJS.enc.Base64)); SkylinkDemo.init({ appKey: "YOUR_APP_KEY_HERE", defaultRoom: "mainHangout" credentials: { startDateTime: (new Date()).toISOString(), duration: 500, credentials: credentials } });

// Example 4: To initialize with callback SkylinkDemo.init("YOUR_APP_KEY_HERE", function(error,success){ if (error){ console.error("Init failed:", error); } else{ console.info("Init succeed:", success); } });


introducePeer

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

Introduces two Peers to each other to start a connection with each other. This will only work if self is a privileged Peer.

Triggers:

introduceStateChange

Parameters:

  • sendingPeerId {String}

    The Peer ID of the peer that initiates the connection with the introduced Peer.

  • receivingPeerId {String}

    The Peer ID of the introduced peer who would be introduced to the initiator Peer.


joinRoom

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

Connects self to the selected room. By default, if room parameter is not provided, it will connect to the default room provided in init() defaultRoom settings. If any existing user media streams attached in Skylink, like for an example, calling getUserMedia() or sendStream() before joinRoom(), self would actually send the current attached user media stream attached. To stop the current attached Stream, please invoke stopStream() before joinRoom() is invoked.

Triggers:

readyStateChange, peerJoined, mediaAccessRequired

Parameters:

  • room {String} Optional

    The room for self to join to. If room is not provided, the room would default to the the defaultRoom option set in init() settings.

  • options {JSON} Optional

    The connection settings for self connection in the room. If both audio and video option is false, there should be no audio and video stream sending from self connection.

    • userData {String | JSON} Optional

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream audio user media access is given.

      • stereo {Boolean} Optional
        The flag that indicates if stereo should be enabled in self connection Stream audio streaming.
      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object audio streaming is muted.
      • optional {Array} Optional
        The optional constraints for audio streaming in self user media Stream object. This follows the optional setting in the MediaStreamConstraints when getUserMedia() is invoked. Tampering this may cause errors in retrieval of self user media Stream object. Refer to this [site for more reference](http://www.sitepoint.com/introduction-getusermedia-api/).
    • video {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming video settings. If false, it means that video streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream video user media access is given.

      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object video streaming is muted.
      • optional {Array} Optional
        The optional constraints for video streaming in self user media Stream object. This follows the optional setting in the MediaStreamConstraints when getUserMedia() is invoked. Tampering this may cause errors in retrieval of self user media Stream object. Refer to this [site for more reference](http://www.sitepoint.com/introduction-getusermedia-api/).
      • resolution {JSON} Optional
        The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Number} Optional
        The self Stream streaming video resolution width.
      • resolution.height {Number} Optional
        The self Stream streaming video resolution height.
      • frameRate {Number} Optional
        DEFAULT: 50 The self Stream streaming video maximum frameRate.
    • bandwidth {String} Optional

      The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.

      • audio {String} Optional
        DEFAULT: 50 The configured audio stream channel for the self Stream object bandwidth that audio streaming should use in kb/s.
      • video {String} Optional
        DEFAULT: 256 The configured video stream channel for the self Stream object bandwidth that video streaming should use in kb/s.
      • data {String} Optional
        DEFAULT: 1638400 The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • manualGetUserMedia {Boolean} Optional

      The flag that indicates if joinRoom() should not invoke getUserMedia() automatically but allow the developer's application to invoke getUserMedia() manually in the application. When user media access is required, the event mediaAccessRequired will be triggered.

  • callback {Function} Optional

    The callback fired after self has joined the room successfully with the provided media settings or have met with an exception. The callback signature is function (error, success).

    • error {JSON}

      The error object received in the callback. If received as null, it means that there is no errors.

      • error {Array}
        The exception thrown that caused the failure for joining the room.
      • errorCode {JSON}
        The READY_STATE_CHANGE_ERROR if there is an readyStateChange event error that caused the failure for joining the room. [Rel: Skylink.READY_STATE_CHANGE_ERROR]
      • room {Object | String}
        The selected room that self is trying to join to.
    • success {JSON}

      The success object received in the callback. If received as null, it means that there are errors.

      • room {Array}
        The selected room that self has succesfully joined to.
      • peerId {String}
        The self Peer ID that would be reflected remotely to peers in the room.
      • peerInfo {JSON}
        The connection settings for self connection in the room. If both audio and video option is false, there should be no audio and video stream sending from self connection.
      • peerInfo.userData {String | JSON}
        The custom user data information set by developer. This custom user data can also be set in setUserData().
      • peerInfo.audio {Boolean | JSON} Optional
        DEFAULT: false The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream audio user media access is given.
      • peerInfo.audio.stereo {Boolean} Optional
        The flag that indicates if stereo should be enabled in self connection Stream audio streaming.
      • peerInfo.video {Boolean | JSON} Optional
        DEFAULT: false The self Stream streaming video settings. If false, it means that video streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream video user media access is given.
      • peerInfo.video.resolution {JSON} Optional
        The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • peerInfo.video.resolution.width {Number} Optional
        The self Stream streaming video resolution width.
      • peerInfo.video.resolution.height {Number} Optional
        The self Stream streaming video resolution height.
      • peerInfo.video.frameRate {Number} Optional
        DEFAULT: 50 The self Stream streaming video maximum frameRate.
      • peerInfo.video.screenshare {Boolean} Optional
        DEFAULT: false The flag that indicates if the self connection Stream object sent is a screensharing stream or not.
      • peerInfo.bandwidth {String} Optional
        The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • peerInfo.bandwidth.audio {String} Optional
        DEFAULT: 50 The configured audio stream channel for the self Stream object bandwidth that audio streaming should use in kb/s.
      • peerInfo.bandwidth.video {String} Optional
        DEFAULT: 256 The configured video stream channel for the self Stream object bandwidth that video streaming should use in kb/s.
      • peerInfo.bandwidth.data {String} Optional
        DEFAULT: 1638400 The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
      • peerInfo.mediaStatus {JSON}
        The self Stream mute settings for both audio and video streamings.
      • peerInfo.mediaStatus.audioMuted {Boolean} Optional
        DEFAULT: true The flag that indicates if the self Stream object audio streaming is muted. If there is no audio streaming enabled for the self, by default, it is set to true.
      • peerInfo.mediaStatus.videoMuted {Boolean} Optional
        DEFAULT: true The flag that indicates if the self Stream object video streaming is muted. If there is no video streaming enabled for the Peer connection, by default, it is set to true.
      • peerInfo.agent {JSON}
        The self platform agent information.
      • peerInfo.agent.name {String}
        The self platform browser or agent name.
      • peerInfo.agent.version {Number}
        The self platform browser or agent version.
      • peerInfo.agent.os {Number}
        The self platform name.
      • peerInfo.room {String}
        The current room that the self is in.

Example:

        

// To just join the default room without any video or audio // Note that calling joinRoom without any parameters // still sends any available existing MediaStreams allowed. // See Examples 2, 3, 4 and 5 etc to prevent video or audio stream SkylinkDemo.joinRoom();

// To just join the default room with bandwidth settings SkylinkDemo.joinRoom({ bandwidth: { data: 14440 } });

// Example 1: To call getUserMedia and joinRoom seperately SkylinkDemo.getUserMedia(); SkylinkDemo.on("mediaAccessSuccess", function (stream)) { attachMediaStream($(".localVideo")[0], stream); SkylinkDemo.joinRoom(); });

// Example 2: Join a room without any video or audio SkylinkDemo.joinRoom("room_a");

// Example 3: Join a room with audio only SkylinkDemo.joinRoom("room_b", { audio: true, video: false });

// Example 4: Join a room with prefixed video width and height settings SkylinkDemo.joinRoom("room_c", { audio: true, video: { resolution: { width: 640, height: 320 } } });

// Example 5: Join a room with userData and settings with audio, video // and bandwidth SkylinkDemo.joinRoom({ userData: { item1: "My custom data", item2: "Put whatever, string or JSON or array" }, audio: { stereo: true }, video: { resolution: SkylinkDemo.VIDEO_RESOLUTION.VGA, frameRate: 50 }, bandwidth: { audio: 48, video: 256, data: 14480 } });

//Example 6: joinRoom with callback SkylinkDemo.joinRoom(function(error, success){ if (error){ console.log("Error happened. Can not join room"); } else{ console.log("Successfully joined room"); } });


leaveRoom

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

Disconnects self from current connected room.

Triggers:

peerLeft, channelClose, streamEnded

Parameters:

  • stopUserMedia {Boolean} Optional
    DEFAULT: true

    The flag that indicates if leaving the room should automatically stop and clear the existing user media stream attached to skylink.

  • callback {Function} Optional

    The callback fired after self has left the room successfully or have met with an exception. The callback signature is function (error, success).

    • error {Object}

      The error object received in the callback. If received as null, it means that there is no errors.

    • success {JSON}

      The success object received in the callback. If received as null, it means that there are errors.

      • peerId {String}
        The assigned previous Peer ID to self given when self was still connected to the room.
      • previousRoom {String}
        The room self was disconnected from.

Example:

        

//Example 1: Just leaveRoom SkylinkDemo.leaveRoom();

//Example 2: leaveRoom with callback SkylinkDemo.leaveRoom(function(error, success){ if (error){ console.log("Error happened"); } else{ console.log("Successfully left room"); } });


lockRoom

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

Locks the currently connected room to prevent other peers from joining the room.

Triggers:

roomLock

Example:

        

SkylinkDemo.lockRoom();


muteStream

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

Mutes the currently attached Stream object in Skylink.

Triggers:

streamMuted, peerUpdated

Parameters:

  • options {JSON}

    The self Stream streaming muted settings.

    • audioMuted {Boolean} Optional
      DEFAULT: true

      The flag that indicates if self connection Stream object audio streaming is muted. If there is no audio streaming enabled for self connection, by default, it is set to true.

    • videoMuted {Boolean} Optional
      DEFAULT: true

      The flag that indicates if self connection Stream object video streaming is muted. If there is no video streaming enabled for self connection, by default, it is set to true.

Example:

        

SkylinkDemo.muteStream({ audioMuted: true, videoMuted: false });


off

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

Unsubscribes an event handler associated to the event name.

Parameters:

  • eventName {String}

    The Skylink event name to unsubscribe to.

  • callback {Function} Optional

    The event handler to unsubscribe to the associated Skylink event name. If the event handler is not provided, Skylink would unsubscribe all event handlers subscribed to the associated event name.

Example:

        

// Example 1: Unsubscribe all event handlers related to the event SkylinkDemo.off("peerJoined");

// Example 2: Unsubscribe to one event handler SkylinkDemo.off("peerJoined", callback);


on

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

Subscribes an event handler associated to the event name. This event handler will always be triggered when the event name is triggered. If you are looking for subscription event handler to be triggered once, check out once() event subscription.

Parameters:

  • eventName {String}

    The Skylink event name to subscribe to.

  • callback {Function}

    The event handler to subsribe to the associated Skylink event name that would be triggered once the event name is triggered.

Example:

        

SkylinkDemo.on("peerJoined", function (peerId, peerInfo) { alert(peerId + " has joined the room"); });


once

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

Subscribes an event handler associated to the event name that would only be triggered once the provided condition function has been met.

Parameters:

  • eventName {String}

    The Skylink event name to subscribe to.

  • callback {Function}

    The event handler to subscribe to the associated Skylink event name to trigger once the condition has met. If fireAlways option is set toe true, this will always be fired when condition is met.

  • condition {Function} Optional

    The condition function that once the condition has been met, trigger the event handler once. Return in the condition function true to pass as meeting the condition. If the condition function is not provided, the event handler will be triggered once the Skylink event name is triggered.

  • fireAlways {Boolean} Optional
    DEFAULT: false

    The flag that indicates if Skylink should interrupt this once() function once the function has been triggered to not unsubscribe the event handler but to always trigger when the condition has been met.

Example:

        

SkylinkDemo.once("peerConnectionState", function (state, peerId) { alert("Peer has left"); }, function (state, peerId) { return state === SkylinkDemo.PEER_CONNECTION_STATE.CLOSED; });


refreshConnection

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

Refreshes a Peer connection. This feature can be used to refresh a Peer connection when the remote Stream received does not stream any audio/video stream. If there are more than 1 refresh during 5 seconds or refresh is less than 3 seconds since the last refresh initiated by the other peer, it will be aborted.

Triggers:

peerRestart, serverPeerRestart, peerJoined, peerLeft, serverPeerJoined

Parameters:

  • targetPeerId {String | Array} Optional

    The array of targeted Peers connection to refresh the connection with.

  • callback {Function} Optional

    The callback fired after all targeted Peers connection has been initiated with refresh or have met with an exception. The callback signature is function (error, success).

    • error {JSON}

      The error object received in the callback. If received as null, it means that there is no errors.

      • listOfPeers {Array}
        The list of Peers that the refresh connection had been initiated with.
      • refreshErrors {JSON}
        The list of errors occurred based on per Peer basis.
      • refreshErrors.(#peerId) {Object | String}
        The Peer ID that is associated with the error that occurred when refreshing the connection.
    • success {JSON}

      The success object received in the callback. If received as null, it means that there are errors.

      • listOfPeers {Array}
        The list of Peers that the refresh connection had been initiated with.

Example:

        

SkylinkDemo.on("iceConnectionState", function (state, peerId)) { if (iceConnectionState === SkylinkDemo.ICE_CONNECTION_STATE.FAILED) { // Do a refresh SkylinkDemo.refreshConnection(peerId); } });


respondBlobRequest

( peerId ,   transferId ,   [accept=false] ,   )
deprecated
Deprecated: Use .acceptDataTransfer()
  Defined in: source/data-transfer.js:1830      Available since 0.5.0

Responds to a data transfer request by rejecting or accepting the data transfer request initiated by a Peer.

Triggers:

incomingData, dataTransferState

Parameters:

  • peerId {String}

    The sender Peer ID.

  • transferId {String}

    The data transfer ID of the data transfer request to accept or reject.

  • accept {Boolean} Optional
    DEFAULT: false

    The flag that indicates true as a response to accept the data transfer and false as a response to reject the data transfer request.


sendBlobData

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

Starts a Blob data transfer with Peers using the DataChannel connection. You can transfer files using the input fileupload object and accessing the receiving files using FileUpload files property. The File object inherits from the Blob interface which is passable in this method as a Blob object. The receiving Peer have the option to accept or reject the data transfer.

Triggers:

incomingData, incomingDataRequest, dataTransferState, dataChannelState

Parameters:

  • data {Blob}

    The Blob data object to transfer to Peer.

  • timeout {Number} Optional
    DEFAULT: 60

    The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.

  • targetPeerId {String | Array} Optional

    The array of targeted Peers to transfer the data object to. Alternatively, you may provide this parameter as a string to a specific targeted Peer to transfer the data object.

  • callback {Function} Optional

    The callback fired after all the data transfers is completed successfully or met with an exception. The callback signature is function (error, success).

    • error {JSON}

      The error object received in the callback. If received as null, it means that there is no errors.

      • state {String} Optional
        DEFAULT: null Deprecated. The dataTransferState when the error has occurred. This only triggers for a single targeted Peer data transfer.
      • error {Object | String} Optional
        DEFAULT: null Deprecated. The error received when the data transfer fails. This only triggers for single targeted Peer data transfer.
      • transferId {String}
        The transfer ID of the failed data transfer.
      • peerId {String} Optional
        DEFAULT: null The single targeted Peer ID for the data transfer. This only triggers for single targeted Peer data transfer.
      • listOfPeers {Array}
        The list of Peer that the data transfer has been initiated with.
      • isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
      • transferErrors {JSON}
        The list of errors occurred based on per Peer basis.
      • transferErrors.(#peerId) {Object | String}
        The error that occurred when having a DataChannel connection data transfer with associated Peer.
      • transferInfo {JSON}
        The transfer data object information.
      • transferInfo.name {String} Optional
        DEFAULT: transferId The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.
      • transferInfo.size {Number}
        The transfer data size.
      • transferInfo.transferId {String}
        The data transfer ID.
      • transferInfo.dataType {String}
        The type of data transfer initiated. Available types are "dataURL" and "blob".
      • transferInfo.timeout {String}
        The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
      • transferInfo.isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
    • success {JSON}

      The success object received in the callback. If received as null, it means that there are errors.

      • state {String} Optional
        DEFAULT: null Deprecated. The dataTransferState when the data transfer has been completed successfully. This only triggers for a single targeted Peer data transfer.
      • transferId {String}
        The transfer ID of the successful data transfer.
      • peerId {String} Optional
        DEFAULT: null The single targeted Peer ID for the data transfer. This only triggers for single targeted Peer data transfer.
      • listOfPeers {Array}
        The list of Peer that the data transfer has been initiated with.
      • isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
      • transferInfo {JSON}
        The transfer data object information.
      • transferInfo.name {String} Optional
        DEFAULT: transferId The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.
      • transferInfo.size {Number}
        The transfer data size.
      • transferInfo.transferId {String}
        The data transfer ID.
      • transferInfo.dataType {String}
        The type of data transfer initiated. Available types are "dataURL" and "blob".
      • transferInfo.timeout {String}
        The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
      • transferInfo.isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.

Example:

        

// Example 1: Send file to all peers connected SkylinkDemo.sendBlobData(file, 67);

// Example 2: Send file to individual peer SkylinkDemo.sendBlobData(blob, 87, targetPeerId);

// Example 3: Send file with callback SkylinkDemo.sendBlobData(data,{ name: data.name, size: data.size },function(error, success){ if (error){ console.error("Error happened. Could not send file", error); } else{ console.info("Successfully uploaded file"); } });


sendMessage

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

Send a message object or string using the platform signaling socket connection to the list of targeted PeerConnections. To send message objects with DataChannel connections, see sendP2PMessage().

Triggers:

incomingMessage

Parameters:

  • message {String | JSON}

    The message object.

  • targetPeerId {String | Array} Optional

    The array of targeted PeerConnections to transfer the message object to. Alternatively, you may provide this parameter as a string to a specific targeted Peer to transfer the message object.

Example:

        

// Example 1: Send to all peers SkylinkDemo.sendMessage("Hi there!"");

// Example 2: Send to a targeted peer SkylinkDemo.sendMessage("Hi there peer!", targetPeerId);


sendP2PMessage

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

Send a message object or string using the DataChannel connection associated with the list of targeted Peers. The maximum size for the message object would be16Kb.
To send a string length longer than 16kb, please considered to use sendURLData() to send longer strings (for that instance base64 binary strings are long). To send message objects with platform signaling socket connection, see sendMessage().

Triggers:

incomingMessage

Parameters:

  • message {String | JSON}

    The message object.

  • targetPeerId {String | Array} Optional

    The array of targeted Peers to transfer the message object to. Alternatively, you may provide this parameter as a string to a specific targeted Peer to transfer the message object.

Example:

        

// Example 1: Send to all peers SkylinkDemo.sendP2PMessage("Hi there! This is from a DataChannel connection!"");

// Example 2: Send to specific peer SkylinkDemo.sendP2PMessage("Hi there peer! This is from a DataChannel connection!", targetPeerId);


sendStream

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

Replaces the currently attached Stream object in Skylink and refreshes all connection with Peer connections to send the updated Stream object. The application may provide their own MediaStream object to send to all PeerConnections connection.

Triggers:

peerRestart, incomingStream

Parameters:

  • options {Object | JSON}

    The self Stream streaming settings for the new Stream object to replace the current Stream object attached to Skylink. If this parameter is provided as a MediaStream object, the MediaStream object settings for mediaStatus would be detected as unmuted by default.

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream audio user media access is given.

      • stereo {Boolean} Optional
        DEFAULT: false The flag that indicates if stereo should be enabled in self connection Stream audio streaming.
      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object audio streaming is muted.
      • optional {Array} Optional
        The optional constraints for audio streaming in self user media Stream object. This follows the optional setting in the MediaStreamConstraints when getUserMedia() is invoked. Tampering this may cause errors in retrieval of self user media Stream object. Refer to this [site for more reference](http://www.sitepoint.com/introduction-getusermedia-api/).
    • video {Boolean | JSON} Optional
      DEFAULT: false

      The self Stream streaming video settings. If false, it means that video streaming is disabled in the self Stream. If this option is set to true or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream video user media access is given.

      • mute {Boolean} Optional
        DEFAULT: false The flag that indicates if the self Stream object video streaming is muted.
      • resolution {JSON} Optional
        The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Number} Optional
        The self Stream streaming video resolution width.
      • resolution.height {Number} Optional
        The self Stream streaming video resolution height.
      • frameRate {Number} Optional
        DEFAULT: 50 The self Stream streaming video maximum frameRate.
      • optional {Array} Optional
        The optional constraints for video streaming in self user media Stream object. This follows the optional setting in the MediaStreamConstraints when getUserMedia() is invoked. Tampering this may cause errors in retrieval of self user media Stream object. Refer to this [site for more reference](http://www.sitepoint.com/introduction-getusermedia-api/).
  • callback {Function} Optional

    The callback fired after Skylink has replaced the current Stream object successfully with the provided media settings / MediaStream object or have met with an exception. The callback signature is function (error, success).

    • error {Object}

      The error object received in the callback. This is the exception thrown that caused the failure for replacing the current Stream object. If received as null, it means that there is no errors.

    • success {Object}

      The success object received in the callback. The self user media MediaStream object. To display the MediaStream object to a video or audio, simply invoke:
      attachMediaStream(domElement, stream);. If received as null, it means that there are errors.

Example:

        

// Example 1: Send a stream object instead SkylinkDemo.on('mediaAccessSuccess', function (stream) { SkylinkDemo.sendStream(stream); });

// Example 2: Send stream with getUserMedia automatically called for you SkylinkDemo.sendStream({ audio: true, video: false });

// Example 3: Send stream with getUserMedia automatically called for you // and audio is muted SkylinkDemo.sendStream({ audio: { mute: true }, video: false });

// Example 4: Send stream with callback SkylinkDemo.sendStream({ audio: true, video: true },function(error,success){ if (error){ console.log('Error occurred. Stream was not sent: '+error) } else{ console.log('Stream successfully sent: '+success); } });


sendURLData

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

Starts a dataURL data transfer with Peers using the DataChannel connection. The receiving Peers have the option to accept or reject the data transfer.

Triggers:

incomingData, incomingDataRequest, dataTransferState, dataChannelState

Parameters:

  • data {String}

    The dataURL (base64 binary string) string to transfer to Peers.

  • timeout {Number} Optional
    DEFAULT: 60

    The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.

  • targetPeerId {String | Array} Optional

    The array of targeted Peers to transfer the data object to. Alternatively, you may provide this parameter as a string to a specific targeted Peer to transfer the data object.

  • callback {Function} Optional

    The callback fired after all the data transfers is completed successfully or met with an exception. The callback signature is function (error, success).

    • error {JSON}

      The error object received in the callback. If received as null, it means that there is no errors.

      • state {String} Optional
        DEFAULT: null Deprecated. The dataTransferState when the error has occurred. This only triggers for a single targeted Peer data transfer.
      • error {Object | String} Optional
        DEFAULT: null Deprecated. The error received when the data transfer fails. This only triggers for single targeted Peer data transfer.
      • transferId {String}
        The transfer ID of the failed data transfer.
      • peerId {String} Optional
        DEFAULT: null The single targeted Peer ID for the data transfer. This only triggers for single targeted Peer data transfer.
      • listOfPeers {Array}
        The list of Peer that the data transfer has been initiated with.
      • isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
      • transferErrors {JSON}
        The list of errors occurred based on per Peer basis.
      • transferErrors.(#peerId) {Object | String}
        The error that occurred when having a DataChannel connection data transfer with associated Peer.
      • transferInfo {JSON}
        The transfer data object information.
      • transferInfo.name {String} Optional
        DEFAULT: transferId The data transfer ID.
      • transferInfo.size {Number}
        The transfer data size.
      • transferInfo.transferId {String}
        The data transfer ID.
      • transferInfo.dataType {String}
        The type of data transfer initiated. The received type would be "dataURL".
      • transferInfo.timeout {String}
        The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
      • transferInfo.isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
    • success {JSON}

      The success object received in the callback. If received as null, it means that there are errors.

      • state {String} Optional
        DEFAULT: null Deprecated. The dataTransferState when the data transfer has been completed successfully. This only triggers for a single targeted Peer data transfer.
      • transferId {String}
        The transfer ID of the successful data transfer.
      • peerId {String} Optional
        DEFAULT: null The single targeted Peer ID for the data transfer. This only triggers for single targeted Peer data transfer.
      • listOfPeers {Array}
        The list of Peer that the data transfer has been initiated with.
      • isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
      • transferInfo {JSON}
        The transfer data object information.
      • transferInfo.name {String} Optional
        DEFAULT: transferId The data transfer ID.
      • transferInfo.size {Number}
        The transfer data size.
      • transferInfo.transferId {String}
        The data transfer ID.
      • transferInfo.dataType {String}
        The type of data transfer initiated. The received type would be "dataURL".
      • transferInfo.timeout {String}
        The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
      • transferInfo.isPrivate {Boolean}
        The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.

Example:

        

// Example 1: Send dataURL to all peers connected SkylinkDemo.sendURLData(dataURL, 67);

// Example 2: Send dataURL to individual peer SkylinkDemo.sendURLData(dataURL, 87, targetPeerId);

// Example 3: Send dataURL with callback SkylinkDemo.sendURLData(dataURL, 87, function(error, success){ if (error){ console.error("Error happened. Could not send dataURL", error); } else{ console.info("Successfully sent dataURL"); } });


setDebugMode

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

Configures the Skylink debugging tools.

Parameters:

  • options {Boolean | JSON} Optional
    DEFAULT: false

    The debugging settings for Skylink. If provided options is a typeof boolean, storeLogs and trace will be set to true.

    • trace {Boolean} Optional
      DEFAULT: false

      The flag that indicates if Skylink console logs should all output as console.trace(). If console.trace() is not supported, it will fallback and output as console.log().

    • storeLogs {Boolean} Optional
      DEFAULT: false

      The flag that indicates if Skylink should store the logs in SkylinkLogs.

Example:

        

// Example 1: just to enable SkylinkDemo.setDebugMode(true); // or SkylinkDemo.setDebugMode();

// Example 2: just to disable SkylinkDemo.setDebugMode(false);

// Example 3: disable storeLogs or trace feature individually SkylinkDemo.setDebugMode({ trace: true });


setLogLevel

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

Configures the Skylink console log level that would determine the type of console logs that would be printed in the Web console.

Parameters:

  • logLevel {Number} Optional

    The log level of console message logs to be printed in the Web console. [Rel: Skylink.LOG_LEVEL]

Example:

        

//Display logs level: Error, warn, info, log and debug. SkylinkDemo.setLogLevel(SkylinkDemo.LOG_LEVEL.DEBUG);


setUserData

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

Sets the current custom user data information for self. This sets and overwrites the peerInfo.userData value for self. If self is in the room and connected with other peers, the peers will be notified with the peerUpdated event. You may get the current customer user data information for self in getUserData().

Triggers:

peerUpdated

Parameters:

  • userData {JSON | String}

    The custom (or updated) user data information for self provided.

Example:

        

// Example 1: Intial way of setting data before user joins the room SkylinkDemo.setUserData({ displayName: "Bobby Rays", fbUserId: "1234" });

// Example 2: Way of setting data after user joins the room var userData = SkylinkDemo.getUserData(); userData.displayName = "New Name"; userData.fbUserId = "1234"; SkylinkDemo.setUserData(userData);


shareScreen

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

Shares the current screen with Peer connections and will refresh all Peer connections to send the screensharing Stream object with HTTPS protocol accessing application. This will require our own Temasys Skylink extension to do screensharing. For screensharing feature in IE / Safari with our Temasys Plugin, please contact us. Currently, Opera does not support screensharing feature. This does not replace the currently attached user media Stream object in Skylink.

Triggers:

mediaAccessSuccess, mediaAccessError, incomingStream

Parameters:

  • enableAudio {JSON} Optional
    DEFAULT: false

    The flag that indicates if self screensharing Stream streaming should have audio. If false, it means that audio streaming is disabled in the remote Stream of self connection.

  • callback {Function} Optional

    The callback fired after Skylink has shared the screen successfully or have met with an exception. The callback signature is function (error, success).

    • error {Object}

      The error object received in the callback. This is the exception thrown that caused the failure for sharing the screen. If received as null, it means that there is no errors.

    • success {Object}

      The success object received in the callback. The self screensharing MediaStream object. To display the MediaStream object to a video or audio, simply invoke:
      attachMediaStream(domElement, stream);. If received as null, it means that there are errors.

Example:

        

// Example 1: Share the screen SkylinkDemo.shareScreen();

// Example 2: Share screen with callback when screen is ready and shared SkylinkDemo.shareScreen(function(error,success){ if (error){ console.log(error); } else{ console.log(success); } });


stopScreen

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

Stops self screensharing Stream object attached to Skylink. If user media Stream object is available, Skylink will refresh all Peer connections to send the user media Stream object.

Triggers:

mediaAccessStopped, streamEnded, incomingStream

Example:

        

SkylinkDemo.stopScreen();


stopStream

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

Stops self user media Stream object attached to Skylink.

Triggers:

mediaAccessStopped, streamEnded

Example:

        

SkylinkDemo.stopStream();


unlockRoom

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

Unlocks the currently connected room to allow other peers to join the room.

Triggers:

roomLock

Example:

        

SkylinkDemo.unlockRoom();


log.debug

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

Handles the console.debug console log message.

Parameters:

  • message {Array | String}

    The console log message contents.

  • 0 {String} Optional

    The Peer ID the message is associated with.

  • debugObject {Object | String} Optional

    The console debugging message object to accompany and display that associates with the console log message.

Example:

        

// Logging for message log.debug("This is my message", object);


log.error

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

Handles the console.error console log message.

Parameters:

  • message {Array | String}

    The console log message contents.

  • 0 {String} Optional

    The Peer ID the message is associated with.

  • debugObject {Object | String} Optional

    The console debugging message object to accompany and display that associates with the console log message.

Example:

        

// Logging for external information log.error("There has been an error", object);


log.info

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

Handles the console.info console log message.

Parameters:

  • message {Array | String}

    The console log message contents.

  • 0 {String} Optional

    The Peer ID the message is associated with.

  • debugObject {Object | String} Optional

    The console debugging message object to accompany and display that associates with the console log message.

Example:

        

// Logging for message log.debug("This is my message", object);


log.log

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

Handles the console.log console log message.

Parameters:

  • message {Array | String}

    The console log message contents.

  • 0 {String} Optional

    The Peer ID the message is associated with.

  • debugObject {Object | String} Optional

    The console debugging message object to accompany and display that associates with the console log message.

Example:

        

// Logging for message log.log("This is my message", object);


log.warn

()
private
  Defined in: source/skylink-debug.js:439      Available since 0.5.4

Handles the console.warn console log message.

Parameters:

  • message {Array | String}

    The console log message contents.

  • 0 {String} Optional

    The Peer ID the message is associated with.

  • debugObject {Object | String} Optional

    The console debugging message object to accompany and display that associates with the console log message.

Example:

        

// Logging for message log.debug("Here's a warning. Please do xxxxx to resolve this issue", object);


SkylinkLogs

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

The object that handles the stored Skylink console logs. Skylink setDebugMode() storeLogs must be set as true to enable the storage of logs.


SkylinkLogs.clearAllLogs

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

Clears the stored Skylink console logs.

Parameters:

  • logLevel {Number} Optional

    The specific log level of Skylink console logs that should be cleared. If value is not provided, it will clear all stored console logs. [Rel: Skylink.LOG_LEVEL]


SkylinkLogs.getLogs

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

Gets the stored Skylink console logs.

Parameters:

  • logLevel {Number} Optional

    The specific log level of Skylink console logs that should be returned. If value is not provided, it will return all stored console logs. [Rel: Skylink.LOG_LEVEL]

Returns:

{Array}:

The array of stored console logs based on the log level provided.


SkylinkLogs.printAllLogs

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

Prints all the stored Skylink console logs into the Web console.


_appKey

Attribute Type: {String}
private
  Defined in: source/room-init.js:199      Available since 0.3.0

Stores the Application Key that is configured in the init().


_appKeyOwner

Attribute Type: {String}
private
  Defined in: source/room-init.js:317      Available since 0.5.2

Stores the Skylink server Application Key owner string for the selected room.


_audioFallback

Attribute Type: {Boolean}
required private
  Defined in: source/stream-media.js:480      Available since 0.5.4

The flag indicates that when Skylink tries to get both audio and video stream but Skylink fails to retrieve the user media stream, it should fallback to retrieve audio streaming for the user media stream only.

Default value:

false

_autoIntroduce

Attribute Type: {Boolean}
private
  Defined in: source/peer-privileged.js:33      Available since 0.6.1

Whether this user automatically introduce to other peers.

Default value:

true

_channelOpen

Attribute Type: {Boolean}
required private
  Defined in: source/socket-channel.js:123      Available since 0.5.2

The flag that indicates if the current socket connection with platform signaling is opened.


_CHUNK_DATAURL_SIZE

Attribute Type: {Number}
private final
  Defined in: source/data-process.js:15      Available since 0.5.2

The fixed data chunk size for dataURL (which is a binary string (base64) and known as data URIs) data transfers using DataChannel connection.


_CHUNK_FILE_SIZE

Attribute Type: {Number}
private final
  Defined in: source/data-process.js:1      Available since 0.5.2

The fixed data chunk size for Blob data transfers using DataChannel connection.


_dataChannels

Attribute Type: {JSON}
private
  Defined in: source/data-channel.js:63      Available since 0.2.0

Stores the list of DataChannel connections.

Keys:

  • (#peerId) {Array}

    The Peer ID associated with the list of DataChannel connections.

    • main {Object}

      The DataChannel connection object that is used for messaging only associated with the Peer connection. This is the sole channel for sending P2P messages in sendP2PMessage(). This connection will always be kept alive until the Peer connection has ended. The channelName for this reserved key is "main".

    • (#channelName) {Object}

      The DataChannel connection object that is used temporarily for a data transfer associated with the Peer connection. This is using caused by methods sendBlobData() and sendURLData(). This connection will be closed once the transfer has completed or terminated. The channelName is usually the data transfer ID.


_dataTransfersTimeout

Attribute Type: {JSON}
required private
  Defined in: source/data-transfer.js:225      Available since 0.4.1

Stores the list of ongoing data transfer timeouts using the setTimeout objects for each DataChannel connection transfer.

Keys:

  • (#channelName) {Object}

    The timeout for the associated DataChannel connection.


_DC_PROTOCOL_TYPE

Attribute Type: {JSON}
private final
  Defined in: source/data-transfer.js:29      Available since 0.5.2

The list of Protocol types that is used for transfers and messaging using the DataChannel connection.

Keys:

  • WRQ {String}

    Protocol to initiate a transfer request on the current DataChannel connection. Data transfer step 1.

  • ACK {String}

    Protocol to accept or reject the transfer request. Data transfer step 2.

  • DATA {String}

    Actual binary data or string send based on the ackN in the ACK packet received. Data transfer step 3. This may not occur is step 2 is rejected.

  • CANCEL {String}

    Protocol to terminate an ongoing transfer. This data transfer step can happen after step 2 or 3.

  • ERROR {String}

    Protocol that is sent when a transfer occurs an exception which using causes it to be terminated. This data transfer step can happen after step 2 or 3.

  • MESSAGE {String}

    Protocol that is used to send P2P message objects over the DataChannel connection. This is not related to any data transfer step, but for messaging purposes.


_defaultRoom

Attribute Type: {String}
private
  Defined in: source/room-init.js:211      Available since 0.3.0

Stores the default room that is configured in the init(). If no room is provided in joinRoom(), this is the room that self would join to by default. If the value is not provided in init(), by default, the value is the Application Key that is configured in init().

Default value:

Skylink._appKey

_defaultStreamSettings

Attribute Type: {JSON}
private
  Defined in: source/stream-media.js:225      Available since 0.5.7

Stores the Skylink default streaming settings.

Keys:

  • audio {Boolean | JSON} Optional

    The default streaming audio settings. If false, it means that audio streaming is disabled in self connection Stream.

    • stereo {Boolean} Optional

      The default flag that indicates if stereo should be enabled in self connection Stream audio streaming.

  • video {Boolean | JSON} Optional

    The default streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.

    • resolution {JSON} Optional

      The default streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]

      • width {Number} Optional
        The default streaming video resolution width.
      • height {Number} Optional
        The default streaming video resolution height.
    • frameRate {Number} Optional

      The default streaming video maximum frameRate.

  • bandwidth {String} Optional

    The default streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.

    • audio {String} Optional

      The default audio stream channel for self Stream object bandwidth that audio streaming should use in kb/s.

    • video {String} Optional

      The default video stream channel for self Stream object bandwidth that video streaming should use in kb/s.

    • data {String} Optional

      The default datachannel channel for self DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.


_downloadDataSessions

Attribute Type: {JSON}
required private
  Defined in: source/data-transfer.js:197      Available since 0.4.1

Stores the list of ongoing data transfer state informations that is received from the sender point in a DataChannel connection based on the associated DataChannel ID.

Keys:

  • (#channelName) {JSON}

    The ongoing data transfer information that is sent to receiving end associated with the DataChannel connection.

    • name {String}

      The data transfer name.

    • size {Number}

      The expected data size of the completed data transfer.

    • isUpload {Boolean}

      The flag that indicates if the transfer is an upload data transfer. In this case, the value should be false.

    • senderPeerId {String}

      The Peer uploader ID.

    • transferId {String}

      The data transfer ID.

    • percentage {Number}

      The data transfer percentage.

    • timeout {Number}

      The data transfer timeout to wait for response before throwing a timeout error.

    • chunkSize {Number}

      The data transfer packet (chunk) size.

    • dataType {String}

      The data transfer packet (chunk) data type.


_downloadDataTransfers

Attribute Type: {JSON}
required private
  Defined in: source/data-transfer.js:180      Available since 0.4.1

Stores the list of ongoing data transfers data packets (chunks) to be received from sending point in a DataChannel connection based on the associated DataChannel ID.

Keys:

  • (#channelName) {Array}

    The ongoing data transfer packets received associated with DataChannel.

    • (#index) {Blob | String}

      The packet index of chunked Blob data object or dataURL string (base64 binary string) received from sending point.


_enableDataChannel

Attribute Type: {Boolean}
private
  Defined in: source/data-channel.js:50      Available since 0.3.0

The flag that indicates if Peers connection should have any DataChannel connections.

Default value:

true

_enableDebugMode

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

The flag that indicates if Skylink debugging mode is enabled. This is not to be confused with setLogLevel() functionality, as that touches the output Web console log levels, and this enables the debugging trace of the logs console.trace() or storage of the console logs.

Default value:

false

_enableDebugStack

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

The flag that indicates if Skylink should store the logs in _storedLogs.

Default value:

false

_enableDebugTrace

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

The flag that indicates if Skylink console logs should all output as console.trace(). If console.trace() is not supported, it will fallback and output as console.log().

Default value:

false

_enableIceTrickle

Attribute Type: {Boolean}
required private
  Defined in: source/ice-connection.js:72      Available since 0.3.0

The flag that indicates if PeerConnections should enable trickling of ICE to connect the ICE connection.

Default value:

true

_enableSTUN

Attribute Type: {Boolean}
required private
  Defined in: source/ice-connection.js:86      Available since 0.5.4

The flag that indicates if PeerConnections ICE gathering should use STUN server connection.

Default value:

true

_enableTURN

Attribute Type: {Boolean}
required private
  Defined in: source/ice-connection.js:99      Available since 0.5.4

The flag that indicates if PeerConnections ICE gathering should use TURN server connection. Tampering this flag may disable any successful Peer connection that is behind any firewalls.

Default value:

true

_EVENTS

Attribute Type: {JSON}
required private
  Defined in: source/skylink-events.js:1      Available since 0.5.2

Stores the list of on() event subscription handlers.

Keys:

  • (#eventName) {Array}

    The array of event subscription handlers that is subscribed using on() method associated with the event name.

    • (#index) {Function}

      The event subscription handler associated with the event name. This is to be triggered multiple times until off() is invoked for this event subscription handler.


_forceSSL

Attribute Type: {Boolean}
required private
  Defined in: source/room-init.js:110      Available since 0.5.4

The flag to enforce an SSL platform signaling and platform server connection. If self domain accessing protocol is https:, SSL connections would be automatically used. This flag is mostly used for self domain accessing protocol that is http: and enforcing the SSL connections for platform signaling and platform server connection.

Default value:

false

_forceTURN

Attribute Type: {Boolean}
required private
  Defined in: source/room-init.js:146      Available since 0.6.1

The flag to enforce TURN server connection for quicker connectivity.

Default value:

false

_forceTURNSSL

Attribute Type: {Boolean}
required private
  Defined in: source/room-init.js:127      Available since 0.6.1

The flag to enforce an SSL TURN server connection. If self domain accessing protocol is https:, SSL connections would be automatically used. This flag is mostly used for self domain accessing protocol that is http: and enforcing the SSL connections for TURN server connection. This will configure TURN server connection using port 443 only and if turns: protocol is supported, it will use turns: protocol.

Default value:

false

_getUserMediaSettings

Attribute Type: {JSON}
private
  Defined in: source/stream-media.js:392      Available since 0.5.6

Stores the getUserMedia MediaStreamConstraints parsed from _streamSettings for user media Stream object.

Keys:

  • audio {Boolean | JSON} Optional

    The flag that indicates if self user media MediaStream would have audio streaming.

    • optional {Array} Optional

      The optional constraints for audio streaming in self user media MediaStream object. Some of the values are set by the audio.optional setting in getUserMedia().

  • video {Boolean | JSON} Optional

    The flag that indicates if self user media MediaStream would have video streaming.

    • mandatory.maxHeight {Number} Optional

      The self user media MediaStream video streaming resolution maximum height.

    • mandatory.maxWidth {Number} Optional

      The self user media MediaStream video streaming resolution maximum width.

    • mandatory.maxFrameRate {Number} Optional

      The self user media MediaStream video streaming maxinmum framerate.

    • optional {Array} Optional

      The optional constraints for video streaming in self user media MediaStream object. Some of the values are set by the video.optional setting in getUserMedia().


_groupMessageList

Attribute Type: {Array}
required private
  Defined in: source/socket-message.js:126      Available since 0.5.10

Stores the list of types of socket messages that requires to be queued or bundled before sending to the server to prevent platform signaling from dropping of socket messages.


_hasMCU

Attribute Type: {Boolean}
private in-development
  Defined in: source/socket-message.js:146      Available since 0.5.4

The flag that indicates if MCU is in the room and is enabled.

Default value:

false

_hasMCU

Attribute Type: {Boolean}
private in-development
  Defined in: source/socket-message.js:114      Available since 0.5.4

The flag that indicates if MCU is enabled.


_ICEConnectionFailures

Attribute Type: {JSON}
required private
  Defined in: source/ice-connection.js:141      Available since 0.5.8

Stores the list of Peer connection ICE connection failures. After an third attempt of ICE connection failure, the trickling of ICE would be disabled.

Keys:

  • (#peerId) {Number}

    The Peer ID associated with the number of Peer connection ICE connection attempt failures.


_INTEROP_MULTI_TRANSFERS

Attribute Type: {Array}
private final
  Defined in: source/data-transfer.js:63      Available since 0.6.1

The list of platforms that Skylink should fallback to use the DATA_CHANNEL_TYPE.MESSAGING channel for transfers instead of using multi-transfers due to the lack of support in the platform implementations.


_key

Attribute Type: {String}
private
  Defined in: source/room-init.js:306      Available since 0.1.0

Stores the Skylink server connection key for the selected room.


_lastRestart

Attribute Type: {Object}
required private
  Defined in: source/peer-connection.js:39      Available since 0.5.9

Stores the timestamp of the moment when the last Peers connection restarts has happened. Used for the restart Peers connection functionality.


_LOG_KEY

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

The format string that is printed in every Skylink console logs for Skylink logs identification.
Example: "SkylinkJS - <>"


_LOG_LEVELS

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

Stores the list of Skylink console logging levels in an array.


_logLevel

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

Stores the current Skylink log level. By default, the value is ERROR.

Default value:

Skylink.LOG_LEVEL.ERROR

_mediaScreen

Attribute Type: {Object}
private
  Defined in: source/stream-media.js:198      Available since 0.6.0

Stores the self screensharing MediaStream.


_mediaScreenClone

Attribute Type: {Object}
private
  Defined in: source/stream-media.js:209      Available since 0.6.0

Stores the self screensharing audio MediaStream for browsers that do not support bundling of screensharing MediaStream with audio: true. The current _mediaScreen clones this MediaStream object and .addTrack() with the screensharing MediaStream object video MediaStreamTrack object.


_mediaStream

Attribute Type: {Object}
private
  Defined in: source/stream-media.js:187      Available since 0.5.6

Stores the self user media MediaStream object.


_mediaStreamsStatus

Attribute Type: {JSON}
private
  Defined in: source/stream-media.js:461      Available since 0.5.6

Stores self Stream mute settings for both audio and video streamings.

Keys:

  • audioMuted {Boolean} Optional

    The flag that indicates if self connection Stream object audio streaming is muted. If there is no audio streaming enabled for self connection, by default, it is set to true.

  • videoMuted {Boolean} Optional

    The flag that indicates if self connection Stream object video streaming is muted. If there is no video streaming enabled for self connection, by default, it is set to true.


_MOZ_CHUNK_FILE_SIZE

Attribute Type: {Number}
private final
  Defined in: source/data-process.js:30      Available since 0.5.2

The fixed data chunk size for Blob data type for transfers using DataChanel connection on Firefox based browsers. Limitations is different for Firefox as tested in some PCs (linux predominantly) that sending a packet size of 49152kb from another browser reflects as 16384kb packet size when received.


_onceEvents

Attribute Type: {JSON}
required private
  Defined in: source/skylink-events.js:1140      Available since 0.5.4

Stores the list of once() event subscription handlers.

Keys:

  • (#eventName) {Array}

    The array of event subscription handlers that is subscribed using once() method associated with the event name.

    • (#index) {Function}

      The event subscription handler associated with the event name. This is to be triggered once when condition is met. Alternatively, the once() event subscription handler can be unsubscribed with off() before condition is met.


_parentKey

Attribute Type: {String}
private
  Defined in: source/peer-privileged.js:57      Available since 0.6.1

Parent key in case the current key is alias. If the current key is not alias, this is the same as _appKey

Default value:

null

_path

Attribute Type: {String}
required private
  Defined in: source/room-init.js:159      Available since 0.1.0

The constructed REST path that Skylink makes a HTTP /GET from to retrieve the connection information required.


_peerCandidatesQueue

Attribute Type: {JSON}
required private
  Defined in: source/ice-candidate.js:1      Available since 0.5.1

Stores the list of buffered ICE candidates received before RTCPeerConnection.setRemoteDescription is called. Adding ICE candidates before receiving the remote session description causes an ICE connection failures in a number of instances.

Keys:

  • (#peerId) {Array}

    The Peer ID associated with the list of buffered ICE candidates.

    • (#index) {Object}

      The buffered RTCIceCandidate object associated with the Peer.


_peerConnectionHealth

Attribute Type: {JSON}
required private
  Defined in: source/peer-handshake.js:61      Available since 0.5.5

Stores the list of Peer connections that has connection established successfully. When the Peer connection has a successful ICE connection state of "completed", it stores the Peer connection as "healthy".

Keys:

  • (#peerId) {Boolean}

    The flag that indicates if the associated Peer connection is in a "healthy" state. If the value is true, it means that the Peer connectin is in a "healthy" state.


_peerConnectionHealthTimers

Attribute Type: {JSON}
required private
  Defined in: source/peer-handshake.js:40      Available since 0.5.5

Stores the list of Peer connection health timeout objects that waits for any existing Peer "healthy" state in successful _peerConnectionHealth. If timeout has reached it's limit and does not have any "healthy" connection state with Peer connection, it will restart the connection again with _restartPeerConnection().

Keys:

  • (#peerId) {Object}

    The timeout object set using setTimeout() that does the wait for any "healthy" state connection associated with the Peer connection. This will be removed when the Peer connection has ended or when the Peer connection has been met with a "healthy" state.


_peerConnections

Attribute Type: {JSON}
required private
  Defined in: source/peer-connection.js:65      Available since 0.1.0

Stores the list of Peers connection.

Keys:

  • (#peerId) {Object}

    The Peer ID associated to the RTCPeerConnection object.


_peerHSPriorities

Attribute Type: {JSON}
required private
  Defined in: source/peer-handshake.js:78      Available since 0.5.0

Stores the list of Peer handshake connection weights. This is implemented to prevent the conflict of sending WELCOME to peer and receiving WELCOME from peer at the same time. To handle this event, both self and the peer has to generate a weight initially. Then in the Skylink/_welcomeHandler:attr when conflict WELCOME message is received, the handler woudl check if there is already an existing Peer connection object with the peer (due to the initialisation in the received ENTER). If so the handler would then compare the received weight if it is higher than the weight generated for this peer. The one with the highest weight would have the "priority" to initiate the WebRTC layer of handshake and start sending the OFFER session description.

Keys:

  • (#peerId) {Number}

    The generated weight for associated Peer peer. The weight is generated with Date.getTime().


_peerIceTrickleDisabled

Attribute Type: {JSON}
required private
  Defined in: source/ice-candidate.js:21      Available since 0.5.8

Stores the list of flags associated to the PeerConnections to disable trickle ICE as attempting to establish an ICE connection failed after many trickle ICE connection attempts. To ensure the stability and increase the chances of a successful ICE connection, track the Peer connection and store it as a flag in this list to disable trickling of ICE connections.

Keys:

  • (#peerId) {Boolean}

    The Peer trickle ICE disabled flag. If value is true, it means that trickling of ICE is disabled for subsequent connection attempt.


_peerInformations

Attribute Type: {JSON}
required private
  Defined in: source/peer-data.js:1      Available since 0.3.0

Stores the list of all Peers information.

Keys:

  • (#peerId) {JSON}

    The Peer ID associated with the information.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo should be enabled in the Peer connection Stream audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.

_peerList

Attribute Type: {Object}
private
  Defined in: source/peer-privileged.js:70      Available since 0.6.1

List of peers retrieved from signaling

Default value:

null

_peerRestartPriorities

Attribute Type: {JSON}
required private
  Defined in: source/peer-connection.js:78      Available since 0.6.0

Stores the list of Peer connection restart weights received that would be compared against to indicate if Peer connection should initiates a restart from the other connection end should. The one that sends restart later is the one who initiates the restart.

Keys:

  • (#peerId) {Number}

    The Peer ID associated with the connection restart handshake reconnection weights. The weight is generated with Date.valueOf().


_readyState

Attribute Type: {Number}
required private
  Defined in: source/room-init.js:293      Available since 0.1.0

Stores the current Skylink room connection retrieval ready state. [Rel: Skylink.READY_STATE_CHANGE]


_receiveOnly

Attribute Type: {Boolean}
required private
  Defined in: source/socket-message.js:160      Available since 0.5.10

The flag that indicates that the current self connection should only receive streaming Stream objects from other Peer connection and not send streaming Stream objects to other Peer connection.

Default value:

false

_retryCount

Attribute Type: {Number}
required private
  Defined in: source/peer-connection.js:52      Available since 0.5.10

Stores the counter of the number of consecutive Peers connection restarts retries.


_room

Attribute Type: {JSON}
required private
  Defined in: source/room-init.js:328      Available since 0.5.2

Stores the room connection information that is passed for starting the selected room connection. Some of these information are also used and required to send for every messages sent to the platform signaling connection for targeting the correct room and self identification in the room.

Keys:

  • id {String}

    The room ID for identification to the platform signaling connection.

  • token {String}

    The generated room token given by the platform server for starting the platform signaling connection.

  • startDateTime {String}

    The start datetime stamp (in The startDateTime in (ISO 8601 format) that the call has started sent by the platform server as an indication for the starting datetime of the platform signaling connection to self.

  • duration {String}

    The duration of the room meeting (in hours). This duration will not affect non persistent room.

  • connection {JSON}

    Connection The RTCPeerConnection constraints and configuration.

    • peerConstraints {JSON}

      Deprecated feature. The RTCPeerConnection constraints that is passed in this format new RTCPeerConnection(config, constraints);. This feature is not documented in W3C Specification draft and not advisable to use.

    • peerConfig {JSON}

      The RTCPeerConnection RTCConfiguration.

    • offerConstraints {JSON}

      Deprecated feature. The RTCPeerConnection RTCOfferOptions used in RTCPeerConnection.createOffer(successCb, failureCb, options);.

    • sdpConstraints {JSON}

      Not in use. The RTCPeerConnection RTCAnswerOptions to be used in RTCPeerConnection.createAnswer(successCb, failureCb, options);. This is currently not in use due to not all browsers supporting this feature yet.

    • mediaConstraints {JSON}

      Deprecated feature. The getUserMedia() MediaStreamConstraints in getUserMedia(constraints, successCb, failureCb);.


_roomCredentials

Attribute Type: {String}
private optional
  Defined in: source/room-init.js:264      Available since 0.3.0

Stores the room credentials for Application Key. This is required for rooms connecting without CORS verification or starting a new persistent room meeting. To generate the credentials:

  • Concatenate a string that consists of the room name the room meeting duration (in hours) and the start date timestamp (in ISO 8601 format). Format room + duration + startDateTimeStamp.
  • Hash the concatenated string with the Application Key token using SHA-1. You may use the CryptoJS.HmacSHA1 function to do so. Example var hash = CryptoJS.HmacSHA1(concatenatedString, token);.
  • Convert the hash to a Base64 encoded string. You may use the CryptoJS.enc.Base64 function to do so. Example var base64String = hash.toString(CryptoJS.enc.Base64); .
  • Encode the Base64 encoded string to a URI component using UTF-8 encoding with encodeURIComponent(). Example var credentials = encodeURIComponent(base64String); and the duration.

_roomDuration

Attribute Type: {Number}
private optional
  Defined in: source/room-init.js:247      Available since 0.3.0

Stores the new persistent room meeting duration (in hours) that the current new meeting duration should be in the room that was selected to join. The duration will not affect non persistent room connection. The persistent room feature is configurable in the Application Key in the developer console.


_roomLocked

Attribute Type: {Boolean}
private
  Defined in: source/room-connection.js:83      Available since 0.5.2

The flag that indicates if the currently joined room is locked.


_roomServer

Attribute Type: {String}
private
  Defined in: source/room-init.js:183      Available since 0.5.2

The platform server URL that Skylink can construct the REST path with to make a HTTP /GET to retrieve the connection information required. If the value is not the default value, it's mostly for debugging purposes. It's not advisable to allow developers to set the custom server URL unless they are aware of what they are doing, as this is a debugging feature.

Default value:

"//api.temasys.com.sg"

_roomStart

Attribute Type: {String}
private optional
  Defined in: source/room-init.js:229      Available since 0.3.0

Stores the new persistent room meeting start datetime stamp in (ISO 8601 format). This will start a new meeting based on the starting datetime stamp in the room that was selected to join. The start date time of the room will not affect non persistent room connection. The persistent room feature is configurable in the Application Key in the developer console.


_screenSharingAvailable

Attribute Type: {Boolean}
private
  Defined in: source/stream-media.js:378      Available since 0.5.6

The flag that indicates if self browser supports the screensharing feature. Currently, Opera does not support screensharing and only premium Temasys plugins support this screensharing feature.

Default value:

false

_screenSharingGetUserMediaSettings

Attribute Type: {JSON}
private
  Defined in: source/stream-media.js:424      Available since 0.6.1

Stores the getUserMedia MediaStreamConstraints parsed from _streamSettings for screensharing stream object.

Keys:

  • audio {Boolean | JSON} Optional

    The flag that indicates if self user media MediaStream would have audio streaming.

    • optional {Array} Optional

      The optional constraints for audio streaming in self user media MediaStream object. Some of the values are set by the audio.optional setting in getUserMedia().

  • video {Boolean | JSON} Optional

    The flag that indicates if self user media MediaStream would have video streaming.

    • mandatory.maxHeight {Number} Optional

      The self user media MediaStream video streaming resolution maximum height.

    • mandatory.maxWidth {Number} Optional

      The self user media MediaStream video streaming resolution maximum width.

    • mandatory.maxFrameRate {Number} Optional

      The self user media MediaStream video streaming maxinmum framerate.

    • optional {Array} Optional

      The optional constraints for video streaming in self user media MediaStream object. Some of the values are set by the video.optional setting in getUserMedia().


_screenSharingStreamSettings

Attribute Type: {JSON}
private
  Defined in: source/stream-media.js:345      Available since 0.6.1

Stores self screensharing Stream streaming settings.

Keys:

  • audio {Boolean | JSON} Optional

    The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of self connection.

    • stereo {Boolean} Optional

      The flag that indicates if stereo should be enabled in self connection Stream audio streaming.

  • video {Boolean | JSON}

    The self Stream streaming video settings.

    • screenshare {Boolean} Optional

      The flag that indicates if the self connection Stream object sent is a screensharing stream or not. In this case, the value is true for screensharing Stream object.

  • bandwidth {String} Optional

    The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.


_selectedAudioCodec

Attribute Type: {String}
private
  Defined in: source/stream-media.js:47      Available since 0.5.10

Stores the preferred Peer connection streaming audio codec.

Default value:

Skylink.AUDIO_CODEC.AUTO

_selectedRoom

Attribute Type: {String}
private
  Defined in: source/room-connection.js:67      Available since 0.3.0

Stores the current room self is joined to. The selected room will be usually defaulted to _defaultRoom if there is no selected room in joinRoom().

Default value:

Skylink._defaultRoom

_selectedVideoCodec

Attribute Type: {String}
private
  Defined in: source/stream-media.js:59      Available since 0.5.10

Stores the preferred Peer connection streaming video codec.

Default value:

Skylink.VIDEO_CODEC.AUTO

_serverRegion

Attribute Type: {String}
private
  Defined in: source/room-init.js:172      Available since 0.5.0

The regional server that Skylink should connect to for fastest connectivity.


_SIG_MESSAGE_TYPE

Attribute Type: {JSON}
private readonly
  Defined in: source/socket-message.js:13      Available since 0.5.6

The list of Protocol types that is used for messaging using the platform signaling socket connection.

Keys:

  • JOIN_ROOM {String}

    Protocol sent from Skylink to platform signaling to let self join the room. Join room Step 1.

  • IN_ROOM {String}

    Protocol received from platform signaling to inform Skylink that self has joined the room. Join room Step 2 (Completed).

  • ENTER {String}

    Protocol Skylink sends to all Peer peers in the room to start handshake connection. Handshake connection Step 1.

  • WELCOME {String}

    Protocol received to Peer as a response to self ENTER message. This is sent as a response to Peer ENTER message. Handshake connection Step 2.

  • OFFER {String}

    Protocol sent to Peer as a response to the WELCOME message received after generating the offer session description with RTCPeerConnection.createOffer(). This is received as a response from Peer after sending WELCOME message and requires setting into the Peer connection before sending the ANSWER response. Handshake connection Step 3.

  • ANSWER {String}

    Protocol received from Peer as a response to self OFFER message offer session description and requires setting into the Peer connection. This is sent to Peer as a response to the OFFER message received after setting the received OFFER message and generating the answer session description with RTCPeerConnection.createAnswer(). Handshake connection Step 4 (Completed).

  • CANDIDATE {String}

    Protocol received from Peer when connection ICE candidate has been generated and requires self to add to the Peer connection.

  • BYE {String}

    Protocol received from platform signaling when a Peer has left the room.

  • REDIRECT {String}

    Protocol received from platform signaling when self is kicked out from the currently joined room.

  • UPDATE_USER {String}

    Protocol received when a Peer information has been updated. The message object should contain the updated peer information. This is broadcasted by self when self peer information is updated.

  • ROOM_LOCK {String}

    Protocol received when the current joined room lock status have been updated. The message object should contain the updated room lock status. This is broadcasted by self when self updates the room lock status.

  • MUTE_VIDEO {String}

    Protocol received when a Peer Stream video media streaming muted status have been updated. The message object should contain the updated Stream video media streaming muted status. This is broadcasted by self when self Stream video media streaming muted status have been updated.

  • MUTE_AUDIO {String}

    Protocol received when a Peer connection Stream audio media streaming muted status have been updated. The message object should contain the updated Stream audio media streaming muted status. This is broadcasted by self when self Stream audio media streaming muted status have been updated.

  • PUBLIC_MESSAGE {String}

    Protocol received when a Peer broadcasts a message object to all Peer peers via the platform signaling socket connection. This is broadcasted by self when self sends the message object.

  • PRIVATE_MESSAGE {String}

    Protocol received when a Peer sends a message object targeted to several Peer peers via the platform signaling socket connection. This is sent by self when self sends the message object.

  • RESTART {String}

    Protocol received when a Peer connection requires a reconnection. At this point, the Peer connection have to recreate the RTCPeerConnection object again. This is sent by self when self initiates the reconnection.

  • STREAM {String}

    Protocol received when a Peer connection Stream status have changed.

  • GET_PEERS {String}

    Protocol for privileged self to get the list of Peer peers under the same parent Application Key.

  • PEER_LIST {String}

    Protocol to retrieve a list of peers under the same parent.

  • INTRODUCE {String}

    Protocol sent to the platform signaling to introduce Peer peers to each other.

  • INTRODUCE_ERROR {String}

    Protocol received when Peer peers introduction failed.

  • APPROACH {String}

    Protocol to indicate that a Peer has been introduced. At this point, self would send an ENTER to introduced Peer to start the handshake connection.

  • GROUP {String}

    Protocol received that bundles messages together when socket messages are sent less than 1 second interval apart from the previous sent socket message. This would prevent receiving REDIRECT from the platform signaling.


_signalingServer

Attribute Type: {String}
private
  Defined in: source/socket-channel.js:136      Available since 0.5.2

Stores the platform signaling endpoint URI to open socket connection with.


_signalingServerPort

Attribute Type: {Number}
private
  Defined in: source/socket-channel.js:158      Available since 0.5.4

Stores the current platform signaling port to open socket connection with.


_signalingServerProtocol

Attribute Type: {String}
private
  Defined in: source/socket-channel.js:147      Available since 0.5.4

Stores the current platform signaling protocol to open socket connection with.


_socket

Attribute Type: {Object}
required private
  Defined in: source/socket-channel.js:169      Available since 0.1.0

Stores the socket.io-client io object that handles the middleware socket connection with platform signaling.


_socketMessageQueue

Attribute Type: {Array}
required private
  Defined in: source/socket-channel.js:32      Available since 0.5.8

Stores the queued socket messages to sent to the platform signaling to prevent messages from being dropped due to messages being sent in less than a second interval.


_socketMessageTimeout

Attribute Type: {Object}
required private
  Defined in: source/socket-channel.js:46      Available since 0.5.8

Limits the socket messages being sent in less than a second interval using the setTimeout object to prevent messages being sent in less than a second interval. The messaegs are stored in _socketMessageQueue.


_socketPorts

Attribute Type: {JSON}
required private
  Defined in: source/socket-channel.js:63      Available since 0.5.8

Stores the list of fallback ports that Skylink can attempt to establish a socket connection with platform signaling.

Keys:

  • http:// {Array}

    The array of HTTP protocol fallback ports. By default, the ports are [80, 3000].

  • https:// {Array}

    The The array of HTTP protocol fallback ports. By default, the ports are [443, 3443].


_socketTimeout

Attribute Type: {Number}
required private
  Defined in: source/socket-channel.js:182      Available since 0.5.4

Stores the timeout (in ms) set to await in seconds for response from platform signaling before throwing a connection timeout exception when Skylink is attemtping to establish a connection with platform signaling. If the value is 0, it will use the default timeout from socket.io-client that is in 20000.

Default value:

0

_socketUseXDR

Attribute Type: {Boolean}
required private
  Defined in: source/socket-channel.js:199      Available since 0.5.4

The flag that indicates if the current socket connection for transports types with "Polling" uses XDomainRequest.aspx) instead of XMLHttpRequest due to the IE 8 / 9 XMLHttpRequest not supporting CORS access.

Default value:

false

_storedLogs

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

Stores all Skylink console logs.


_streamSettings

Attribute Type: {JSON}
private
  Defined in: source/stream-media.js:286      Available since 0.5.6

Stores self user media Stream streaming settings. If both audio and video option is false, there should be no receiving remote Stream object from self connection.

Keys:

  • audio {Boolean | JSON} Optional

    The self Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of self connection.

    • stereo {Boolean} Optional

      The flag that indicates if stereo should be enabled in self connection Stream audio streaming.

    • optional {Array} Optional

      The optional constraints for audio streaming in self user media Stream object. Some of the values are set by the audio.optional setting in getUserMedia().

  • video {Boolean | JSON} Optional

    The self Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of self connection.

    • resolution {JSON} Optional

      The self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]

      • width {Number} Optional
        The self Stream streaming video resolution width.
      • height {Number} Optional
        The self Stream streaming video resolution height.
    • frameRate {Number} Optional

      The self Stream streaming video maximum frameRate.

    • screenshare {Boolean} Optional

      The flag that indicates if the self connection Stream object sent is a screensharing stream or not. In this case, the value is false for user media Stream object.

    • optional {Array} Optional

      The optional constraints for video streaming in self user media Stream object. Some of the values are set by the video.optional setting in getUserMedia().

  • bandwidth {String} Optional

    The self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.

    • audio {String} Optional

      The configured audio stream channel for self connection Stream object bandwidth that audio streaming should use in kb/s.

    • video {String} Optional

      The configured video stream channel for the self connection Stream object bandwidth that video streaming should use in kb/s.

    • data {String} Optional

      The configured datachannel channel for self DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.


_timestamp

Attribute Type: {JSON}
required private
  Defined in: source/skylink-events.js:1161      Available since 0.5.8

The throttling function datetime stamp in (ISO 8601 format).


_TRANSFER_DELIMITER

Attribute Type: {String}
private final
  Defined in: source/data-transfer.js:14      Available since 0.5.10

The fixed delimiter that is used in Skylink to concat the DataChannel channelName and the actual transfer ID together based on the transfer ID provided in dataTransferState.


_TURNTransport

Attribute Type: {String}
required private
  Defined in: source/ice-connection.js:127      Available since 0.5.4

Stores the TURN server transport to enable for TURN server connections. [Rel: Skylink.TURN_TRANSPORT]

Default value:

Skylink.TURN_TRANSPORT.ANY

_uploadDataSessions

Attribute Type: {JSON}
required private
  Defined in: source/data-transfer.js:153      Available since 0.4.1

Stores the list of ongoing data transfer state informations that is sent to receiving end in a DataChannel connection based on the associated DataChannel ID.

Keys:

  • (#channelName) {JSON}

    The ongoing data transfer information that is sent to receiving end associated with the DataChannel connection.

    • name {String}

      The data transfer name.

    • size {Number}

      The expected data size of the completed data transfer.

    • isUpload {Boolean}

      The flag that indicates if the transfer is an upload data transfer. In this case, the value should be true.

    • senderPeerId {String}

      The Peer uploader ID.

    • transferId {String}

      The data transfer ID.

    • percentage {Number}

      The data transfer percentage.

    • timeout {Number}

      The data transfer timeout.

    • chunkSize {Number}

      The data transfer packet (chunk) size.

    • dataType {String}

      The data transfer packet (chunk) data type.


_uploadDataTransfers

Attribute Type: {JSON}
required private
  Defined in: source/data-transfer.js:136      Available since 0.4.1

Stores the list of ongoing data transfers data packets (chunks) to be sent to receiving end in a DataChannel connection based on the associated DataChannel ID.

Keys:

  • (#channelName) {Array}

    The ongoing data transfer packets to be sent to receiving end associated with the DataChannel connection.

    • (#index) {Blob | String}

      The packet index of chunked Blob data object or dataURL string (base64 binary string) to be sent to received end.


_usePublicSTUN

Attribute Type: {Boolean}
required private
  Defined in: source/ice-connection.js:114      Available since 0.6.1

The flag to enable using of public STUN server connections.

Default value:

true

_user

Attribute Type: {JSON}
required private
  Defined in: source/peer-data.js:72      Available since 0.5.6

Stores the self credentials that is required to connect to Skylink platform signalling and identification in the signalling socket connection.

Keys:

  • uid {String}

    The self session ID.

  • sid {String}

    The self session socket connection ID. This is used by the signalling socket connection as ID to target self and the peers Peer ID.

  • timeStamp {String}

    The self session timestamp.

  • token {String}

    The self session access token.


_userData

Attribute Type: {JSON | String}
required private
  Defined in: source/peer-data.js:92      Available since 0.5.6

Stores the custom user data information set by developer for self. By default, if no custom user data is set, it is an empty string "".

Default value:

""

AUDIO_CODEC

Attribute Type: {JSON}
readonly
  Defined in: source/stream-media.js:24      Available since 0.5.10

The list of Peer connection streaming audio codecs available. The audio codec will only be use if the browser supports the selected codec, or it will usually default to the browser default codec OPUS.

Keys:

  • AUTO {String}

    The default option to let Skylink use any audio codec selected by the browser generated session description.

  • OPUS {String}

    The option to let Skylink use the OPUS) codec. This is the common and mandantory audio codec used.

  • ISAC {String}

    The option to let Skylink use the iSAC. This only works if the browser supports the iSAC video codec.


CANDIDATE_GENERATION_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/ice-candidate.js:41      Available since 0.4.1

The list of Peer connection ICE candidate generation triggered states. Refer to w3c WebRTC Specification Draft.

Keys:

  • NEW {String}

    The object was just created, and no networking has occurred yet.

  • GATHERING {String}

    The ICE engine is in the process of gathering candidates for connection.

  • COMPLETED {String}

    The ICE engine has completed gathering. Events such as adding a new interface or a new TURN server will cause the state to go back to gathering.


DATA_CHANNEL_STATE

Attribute Type: {JSON}
final
  Defined in: source/data-channel.js:1      Available since 0.1.0

The list of Skylink DataChannel connection triggered states. Refer to w3c WebRTC Specification Draft.
ERROR state is a provided state by Skylink to inform exception in RTCDataChannel error handler.

Keys:

  • CONNECTING {String}

    Attempting to establish a connection.

  • OPEN {String}

    Connection is established.

  • CLOSING {String}

    Connection is closing.

  • CLOSED {String}

    Connection is closed.

  • ERROR {String}

    Connection have met with an exception.


DATA_CHANNEL_TYPE

Attribute Type: {JSON}
final
  Defined in: source/data-channel.js:26      Available since 0.6.1

The types of Skylink DataChannel that serves different functionalities.

Keys:

  • MESSAGING {String}

    DataChannel that is used for messaging only. This is the sole channel for sending P2P messages in sendP2PMessage(). This connection will always be kept alive until the Peer connection has ended.

  • DATA {String}

    DataChannel that is used temporarily for a data transfer. This is using caused by methods sendBlobData() and sendURLData(). This connection will be closed once the transfer has completed or terminated.


DATA_TRANSFER_DATA_TYPE

Attribute Type: {JSON}
final
  Defined in: source/data-process.js:48      Available since 0.1.0

The list of native data types that is transferred through the DataChannel connection. The current supported data types is string. Blob, ArrayBuffer types support is not yet currently handled or implemented.

Keys:

  • BINARY_STRING {String}

    Data is transferred using binary converted strings through the DataChannel connection.

  • ARRAY_BUFFER {String}

    Data is transferred using ArrayBuffers through the DataChannel connection.

  • BLOB {String}

    Data is transferred using Blobs through the DataChannel connection.


DATA_TRANSFER_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/data-transfer.js:98      Available since 0.4.0

The states of a data transfer in a DataChannel connection.

Keys:

  • UPLOAD_REQUEST {String}

    Request to start a data transfer.

  • UPLOAD_STARTED {String}

    Request to start the data transfer has been accepted and data transfer is starting to upload data packets to receiving end.

  • DOWNLOAD_STARTED {String}

    Request to start the data transfer has been accepted and data transfer is starting to receive data packets from sending point.

  • REJECTED {String}

    Request to start a data transfer is rejected.

  • UPLOADING {String}

    The data transfer upload is ongoing with receiving end.

  • DOWNLOADING {String}

    The data transfer download is ongoing with sending point.

  • UPLOAD_COMPLETED {String}

    The data transfer uploaded to receiving end has been completed successfully.

  • DOWNLOAD_COMPLETED {String}

    The data transfer downloaded from sending point has been completed successfully.

  • CANCEL {String}

    The ongoing data transfer has cancelled from receiving end or sending point and has been terminated.

  • ERROR {String}

    The ongoing data transfer has occurred an exception and has been terminated.


DATA_TRANSFER_TYPE

Attribute Type: {JSON}
final
  Defined in: source/data-transfer.js:79      Available since 0.1.0

The types of data transfers to indicate if the DataChannel is uploading or downloading the data transfer.

Keys:

  • UPLOAD {String}

    The DataChannel connection is uploading data packets to receiving end.

  • DOWNLOAD {String}

    The DataChannel connection is downloading data packets from sending point.


DT_PROTOCOL_VERSION

Attribute Type: {String}
required final
  Defined in: source/data-transfer.js:1      Available since 0.5.10

The current version of DT (Data Transfer) Protocol that the Skylink SDK is using.


GET_PEERS_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/peer-privileged.js:1      Available since 0.6.1

The types of get peers states available

Keys:

  • ENQUIRED {String}

    The privileged Peer already enquired signaling for list of peers

  • RECEIVED {String}

    The privileged Peer received list of peers from signaling


HANDSHAKE_PROGRESS

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

The list of Skylink Peer connection handshake triggered states.

Keys:

  • ENTER {String}

    Connection handshake Step 1a. Received ENTER from peer, and Peer connection is initialised to start connection. In this Step, self would sent WELCOME to the peer to start the WebRTC session description connection handshake.

  • WELCOME {String}

    Connection handshake Step 1b. Received WELCOME from peer, and Peer connection is initialised to start connection. In this Step, the WebRTC layer to begin the session description connection handshake starts here and send the local OFFER session description to peer.

  • OFFER {String}

    Connection handshake Step 2a. Received OFFER from peer, and Peer connection has received the remote OFFER session description. In this Step, self would start to send local ANSWER session description to peer.

  • ANSWER {String}

    Connection handshake Step 2b. Received ANSWER from peer, and Peer connection has received the remote ANSWER session description. In this Step, the connection handshaking progress has been completed.

  • ERROR {String}

    Connection handshake has occurred and exception, in this which the connection handshake could have been aborted abruptly and no Peer connection is established.


ICE_CONNECTION_STATE

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

The list of Peer connection ICE connection triggered states. Refer to w3c WebRTC Specification Draft.

Keys:

  • STARTING {String}

    The ICE agent is gathering addresses and/or waiting for remote candidates to be supplied.

  • CHECKING {String}

    The ICE agent has received remote candidates on at least one component, and is checking candidate pairs but has not yet found a connection. In addition to checking, it may also still be gathering.

  • CONNECTED {String}

    The ICE agent has found a usable connection for all components but is still checking other candidate pairs to see if there is a better connection. It may also still be gathering.

  • COMPLETED {String}

    The ICE agent has finished gathering and checking and found a connection for all components.

  • FAILED {String}

    The ICE agent is finished checking all candidate pairs and failed to find a connection for at least one component.

  • DISCONNECTED {String}

    Liveness checks have failed for one or more components. This is more aggressive than "failed", and may trigger intermittently (and resolve itself without action) on a flaky network.

  • CLOSED {String}

    The ICE agent has shut down and is no longer responding to STUN requests.


INTRODUCE_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/peer-privileged.js:17      Available since 0.6.1

The types of peer introduction states available

Keys:

  • INTRODUCING {String}

    The privileged Peer sent the introduction signal

  • ERROR {String}

    The Peer introduction has occurred an exception.


isPrivileged

Attribute Type: {Boolean}
private
  Defined in: source/peer-privileged.js:45      Available since 0.6.1

Whether this user is a privileged user.

Default value:

false

log

Attribute Type: {JSON}
required private scoped
  Defined in: source/skylink-debug.js:344      Available since 0.5.4

The object that handles the logging functionality in Skylink.

Keys:


LOG_LEVEL

Attribute Type: {JSON}
readonly
  Defined in: source/skylink-debug.js:1      Available since 0.5.4

The list of Skylink console logging levels available. Refer to Javascript Web Console.

Keys:

  • DEBUG {Number}

    Displays debug, log, info, warn and error console logs.

  • LOG {Number}

    Displays log, info, warn and error console logs.

  • INFO {Number}

    Displays info, warn and error console logs.

  • WARN {Number}

    Displays warn and error console logs.

  • ERROR {Number}

    This is the default log level. Displays error console logs only.


PEER_CONNECTION_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/peer-connection.js:1      Available since 0.5.0

The list of Skylink Peer connection signaling triggered states. Refer to w3c WebRTC Specification Draft.

Keys:

  • STABLE {String}

    There is no handshaking in progress. This state occurs when handshaking has just started or close.

  • HAVE_LOCAL_OFFER {String}

    The session description "offer" is generated and to be sent.

  • HAVE_REMOTE_OFFER {String}

    The session description "offer" is received. The handshaking has been completed.

  • CLOSED {String}

    The connection is closed.


READY_STATE_CHANGE

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

The list of Skylink platform room initialization ready state that indicates if the required connection information has been retrieved successfully from the platform server to start a connection.

Keys:

  • INIT {Number}

    Retrieval Step 1. The ready state is at it's beginning. When init() is invoked, or when Skylink/joinRoom:attr is invoked with a provided room, it will start proceeding to Step 2.

  • LOADING {Number}

    Retrieval Step 2. Skylink starts retrieving the connection information from the platform server.

  • COMPLETED {Number}

    Retrieval Step 3. The connection information has been retrieved successfully.

  • ERROR {Number}

    Retrieval failure Step. An exception occured while retrieving the connection information. This could also be due to missing dependencies or the lack of WebRTC support.


READY_STATE_CHANGE_ERROR

Attribute Type: {JSON}
readonly
  Defined in: source/room-init.js:30      Available since 0.4.0

The list of Skylink platform room initialization ready state errors when the error state is triggered by readyStateChange The list of ready state change errors.

  • These are the error states from the error object error code.
  • ROOM_LOCKED is deprecated in 0.5.2. Please use Skylink/:attr
  • The states that would occur are:

Keys:

  • API_INVALID {Number}

    Provided Application Key does not exists (invalid).

  • API_DOMAIN_NOT_MATCH {Number}

    Application accessing from backend IP address is not valid for provided Application Key.

  • API_CORS_DOMAIN_NOT_MATCH {Number}

    Application accessing from the CORS domain is not valid for provided Application Key.

  • API_CREDENTIALS_INVALID {Number}

    Credentials provided is not valid for provided Application Key.

  • API_CREDENTIALS_NOT_MATCH {Number}

    Credentials does not match as expected generated credentials for provided Application Key.

  • API_INVALID_PARENT_KEY {Number}

    Provided alias Application Key has an error because parent Application Key does not exists.

  • API_NO_MEETING_RECORD_FOUND {Number}

    For persistent room feature configured Application Key. There is no meeting currently that is open or available to join for self at the current time in the selected room.

  • NO_SOCKET_IO {Number}

    Socket.io dependency is not loaded.

  • NO_XMLHTTPREQUEST_SUPPORT {Number}

    XMLHttpRequest is not supported in current browser.

  • NO_WEBRTC_SUPPORT {Number}

    WebRTC is not supported in current browser.

  • NO_PATH {Number}

    Error thrown when joinRoom() is invoked before init().

  • INVALID_XMLHTTPREQUEST_STATUS {Number}

    XMLHttpRequest does not return a HTTP status code of 200, which is a HTTP failure.

  • ADAPTER_NO_LOADED {Number}

    AdapterJS dependency is not loaded.

  • XML_HTTP_REQUEST_ERROR {Number}

    XMLHttpRequest failure on the network level when attempting to connect to the platform server to retrieve selected room connection information.


REGIONAL_SERVER

Attribute Type: {JSON}
deprecated final
Deprecated: Signaling server selection is handled on the server side based on load and latency.
  Defined in: source/room-init.js:91      Available since 0.5.0

The list of available platform signaling servers Skylink should connect to for faster connectivity.

Keys:

  • APAC1 {String}

    Asia pacific server 1.

  • US1 {String}

    server 1.


SERVER_PEER_TYPE

Attribute Type: {JSON}
readonly
  Defined in: source/peer-connection.js:25      Available since 0.6.1

The types of Skylink server Peers that serves different functionalities.

Keys:

  • MCU {String}

    The server Peer is a MCU server.


SM_PROTOCOL_VERSION

Attribute Type: {String}
required
  Defined in: source/socket-message.js:1      Available since 0.6.0

The current version of SM (Signaling Message) Protocol that the SDK is using.


SOCKET_ERROR

Attribute Type: {JSON}
readonly
  Defined in: source/socket-channel.js:1      Available since 0.5.6

The list of Skylink estalishing socket connection error triggered states.

Keys:

  • CONNECTION_FAILED {Number}

    Skylink have failed to establish a socket connection with platform signaling in the first attempt.

  • RECONNECTION_FAILED {String}

    Skylink have failed to reestablish a socket connection with platform signaling after the first attempt CONNECTION_FAILED.

  • CONNECTION_ABORTED {String}

    Attempt to reestablish socket connection with platform signaling has been aborted after the failed first attempt CONNECTION_FAILED.

  • RECONNECTION_ABORTED {String}

    Attempt to reestablish socket connection with platform signaling has been aborted after several failed reattempts RECONNECTION_FAILED.

  • RECONNECTION_ATTEMPT {String}

    Skylink is attempting to reestablish a socket connection with platform signaling after a failed attempt CONNECTION_FAILED or RECONNECTION_FAILED.


SOCKET_FALLBACK

Attribute Type: {JSON}
readonly
  Defined in: source/socket-channel.js:83      Available since 0.5.6

The list of Skylink fallback socket transport types.

Keys:

  • NON_FALLBACK {String}

    The current socket connection attempt is using the first selected socket connection port for the current selected transport "Polling" or "WebSocket".

  • FALLBACK_PORT {String}

    The current socket connection reattempt is using the next selected socket connection port for HTTP protocol connection with the current selected transport "Polling" or "WebSocket".

  • FALLBACK_PORT_SSL {String}

    The current socket connection reattempt is using the next selected socket connection port for HTTPS protocol connection with the current selected transport "Polling" or "WebSocket".

  • LONG_POLLING {String}

    The current socket connection reattempt is using the next selected socket connection port for HTTP protocol connection with "Polling" after many attempts of "WebSocket" has failed. This occurs only for socket connection that is originally using "WebSocket" transports.

  • LONG_POLLING_SSL {String}

    The current socket connection reattempt is using the next selected socket connection port for HTTPS protocol connection with "Polling" after many attempts of "WebSocket" has failed. This occurs only for socket connection that is originally using "WebSocket" transports.


SYSTEM_ACTION

Attribute Type: {JSON}
readonly
  Defined in: source/room-connection.js:1      Available since 0.5.1

The list of Skylink platform signaling system action that might be given. Upon receiving from the signaling, the application has to reflect the relevant actions given. You may refer to SYSTEM_ACTION_REASON for the types of system action reasons that would be given.

Keys:

  • WARNING {String}

    This action serves a warning to self. Usually if warning is not heeded, it may result in an REJECT action.

  • REJECT {String}

    This action means that self has been kicked out of the current signaling room connection, and subsequent PeerConnections would be disconnected.


SYSTEM_ACTION_REASON

Attribute Type: {JSON}
readonly
  Defined in: source/room-connection.js:24      Available since 0.5.2

The list of Skylink platform signaling code as the reason for the system action given by the current signaling connection. You may refer to SYSTEM_ACTION for the types of system actions that would be given.

Keys:

  • ROOM_LOCKED {String}

    Given as REJECT. The room is locked and self is rejected from joining the room connection.

  • DUPLICATED_LOGIN {String}

    Given as REJECT. The credentials given is already in use, which the signaling server throws an exception for this error. This should rarely happen as Skylink handles this issue.

  • SERVER_ERROR {String}

    Given as REJECT. The connection with the server has an exception that is caught during the server connection.

  • EXPIRED {String}

    Given as REJECT. The persistent room meeting has expired so self is unable to join the room as the end time of the meeting has ended. Depending on other meeting timings available for this room, the persistent room will appear expired.

  • ROOM_CLOSED {String}

    Given as REJECT. The persistent room meeting has ended and has been rendered expired so self is rejected from the room as the meeting is over.

  • ROOM_CLOSING {String}

    Given as WARNING. The persistent room meeting is going to end soon, so this warning is given to inform users before self is rejected from the room.


TURN_TRANSPORT

Attribute Type: {JSON}
readonly
  Defined in: source/ice-connection.js:42      Available since 0.5.4

The list of TURN server transports flags to set for TURN server connections.

Keys:

  • TCP {String}

    Use only TCP transport option. E.g. turn:turnurl:5523?transport=tcp.

  • UDP {String}

    Use only UDP transport option. E.g. turn:turnurl:5523?transport=udp.

  • ANY {String}

    Use any transports option given by the platform signaling. E.g. turn:turnurl:5523?transport=udp or turn:turnurl:5523?transport=tcp.

  • NONE {String}

    Set no transport option in TURN servers. E.g. turn:turnurl:5523

  • ALL {String}

    Use both UCP and TCP transports options. E.g. turn:turnurl:5523?transport=udp and turn:turnurl:5523?transport=tcp.


VERSION

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

The current version of Skylink Web SDK.


VIDEO_CODEC

Attribute Type: {JSON}
readonly
  Defined in: source/stream-media.js:1      Available since 0.5.10

The list of Peer connection streaming video codecs available. The video codec will only be use if the browser supports the selected codec, or it will usually default to the browser default codec VP8.

Keys:

  • AUTO {String}

    The default option to let Skylink use any video codec selected by the browser generated session description.

  • VP8 {String}

    The option to let Skylink use the VP8 codec. This is the common and mandantory video codec used by most browsers.

  • H264 {String}

    The option to let Skylink use the H264 codec. This only works if the browser supports the H264 video codec.


VIDEO_RESOLUTION

Attribute Type: {JSON}
readonly
  Defined in: source/stream-media.js:72      Available since 0.5.6

The list of recommended Stream video resolutions to use for self user media stream. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution.

Keys:

  • QQVGA {JSON}

    QQVGA resolution.

    • width {Number}

      160

    • height {Number}

      120

    • aspectRatio {String}

      4:3

  • HQVGA {JSON}

    HQVGA resolution.

    • width {Number}

      240

    • height {Number}

      160

    • aspectRatio {String}

      3:2

  • QVGA {JSON}

    QVGA resolution.

    • width {Number}

      320

    • height {Number}

      240

    • aspectRatio {String}

      4:3

  • WQVGA {JSON}

    WQVGA resolution.

    • width {Number}

      384

    • height {Number}

      240

    • aspectRatio {String}

      16:10

  • HVGA {JSON}

    HVGA resolution.

    • width {Number}

      480

    • height {Number}

      320

    • aspectRatio {String}

      3:2

  • VGA {JSON}

    VGA resolution.

    • width {Number}

      640

    • height {Number}

      480

    • aspectRatio {String}

      4:3

  • WVGA {JSON}

    WVGA resolution.

    • width {Number}

      768

    • height {Number}

      480

    • aspectRatio {String}

      16:10

  • FWVGA {JSON}

    FWVGA resolution.

    • width {Number}

      854

    • height {Number}

      480

    • aspectRatio {String}

      16:9

  • SVGA {JSON}

    SVGA resolution.

    • width {Number}

      800

    • height {Number}

      600

    • aspectRatio {String}

      4:3

  • DVGA {JSON}

    DVGA resolution.

    • width {Number}

      960

    • height {Number}

      640

    • aspectRatio {String}

      3:2

  • WSVGA {JSON}

    WSVGA resolution.

    • width {Number}

      1024

    • height {Number}

      576

    • aspectRatio {String}

      16:9

  • HD {JSON}

    HD resolution.

    • width {Number}

      1280

    • height {Number}

      720

    • aspectRatio {String}

      16:9

  • HDPLUS {JSON}

    HDPLUS resolution.

    • width {Number}

      1600

    • height {Number}

      900

    • aspectRatio {String}

      16:9

  • FHD {JSON}

    FHD resolution.

    • width {Number}

      1920

    • height {Number}

      1080

    • aspectRatio {String}

      16:9

  • QHD {JSON}

    QHD resolution.

    • width {Number}

      2560

    • height {Number}

      1440

    • aspectRatio {String}

      16:9

  • WQXGAPLUS {JSON}

    WQXGAPLUS resolution.

    • width {Number}

      3200

    • height {Number}

      1800

    • aspectRatio {String}

      16:9

  • UHD {JSON}

    UHD resolution.

    • width {Number}

      3840

    • height {Number}

      2160

    • aspectRatio {String}

      16:9

  • UHDPLUS {JSON}

    UHDPLUS resolution.

    • width {Number}

      5120

    • height {Number}

      2880

    • aspectRatio {String}

      16:9

  • FUHD {JSON}

    FUHD resolution.

    • width {Number}

      7680

    • height {Number}

      4320

    • aspectRatio {String}

      16:9

  • QUHD {JSON}

    resolution.

    • width {Number}

      15360

    • height {Number}

      8640

    • aspectRatio {String}

      16:9


candidateGenerationState

  Defined in: source/skylink-events.js:132      Available since 0.1.0

Event triggered when a Peer connection ICE gathering state has changed.

Event Payload:

  • state {String}

    The Peer connection ICE gathering state. [Rel: Skylink.CANDIDATE_GENERATION_STATE]

  • peerId {String}

    The Peer ID associated with the ICE gathering state.


channelClose

  Defined in: source/skylink-events.js:29      Available since 0.1.0

Event triggered when the platform signaling socket connection has closed. server has closed.


channelError

  Defined in: source/skylink-events.js:53      Available since 0.1.0

Event triggered when Skylink socket connection with the platform signaling has occurred an exception. This happens after a successful socket connection with the platform signaling. Usually at this stage, the signaling socket connection could be disrupted.

Event Payload:

  • error {Object | String}

    The error object thrown that caused the exception.


channelMessage

  Defined in: source/skylink-events.js:39      Available since 0.1.0

Event triggered when Skylink is exchanging socket messages with the platform signaling through the socket connection. This is a debugging feature, and it's not advisable to subscribe to this event unless you are debugging the socket messages received from the platform signaling. from the signaling server.

Event Payload:

  • message {JSON}

    The socket message object data received from the platform signaling.


channelOpen

  Defined in: source/skylink-events.js:20      Available since 0.1.0

Event triggered when the platform signaling socket connection is open and is ready for room connection.


channelRetry

  Defined in: source/skylink-events.js:65      Available since 0.5.6

Event triggered when Skylink attempting to reconnect the socket connection with the platform signaling.

Event Payload:

  • fallbackType {String}

    The fallback socket transport that Skylink is attempting to reconnect with. [Rel: Skylink.SOCKET_FALLBACK]

  • currentAttempt {Number}

    The current reconnection attempt.


dataChannelState

  Defined in: source/skylink-events.js:834      Available since 0.1.0

Event triggered when a Peer connection DataChannel connection state has changed.

Event Payload:

  • state {String}

    The Peer connection DataChannel connection state. [Rel: Skylink.DATA_CHANNEL_STATE]

  • peerId {String}

    The Peer ID associated with the DataChannel connection.

  • error {Object} Optional

    The error object thrown when there is a failure in the DataChannel connection. If received as null, it means that there is no errors.

  • channelName {String}

    The DataChannel connection ID.

  • channelType {String}

    The DataChannel connection functionality type. [Rel: Skylink.DATA_CHANNEL_TYPE]


dataTransferState

  Defined in: source/skylink-events.js:852      Available since 0.4.1

Event triggered when a data transfer made to Peer in a DataChannel connection state has changed.

Event Payload:

  • state {String}

    The data transfer made to Peer in a DataChannel connection state. [Rel: Skylink.DATA_TRANSFER_STATE]

  • transferId {String}

    The transfer ID of the completed data transfer.

  • peerId {String}

    The Peer ID associated with the data transfer.

  • transferInfo {JSON}

    The transfer data object information.

    • data {Blob | String}

      The transfer data object. This is defined only after the transfer data is completed, when the state is DATA_TRANSFER_STATE.DOWNLOAD_COMPLETED and DATA_TRANSFER_STATE.UPLOAD_STARTED
      For Blob data object, see the createObjectURL method on how you can convert the Blob data object to a download link.

    • name {String} Optional

      The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.

    • size {Number}

      The transfer data size.

    • dataType {String}

      The type of data transfer initiated. Available types are "dataURL" and "blob".

    • timeout {String}

      The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.

    • isPrivate {Boolean}

      The flag to indicate if the data transferred targeted Peer peers and not broadcasted to all Peer peers.

  • error {JSON} Optional

    The error object thrown when there is a failure in transferring data.

    • message {Object}

      The exception thrown that caused the failure for transferring data.

    • transferType {String}

      The data transfer type to indicate if the DataChannel is uploading or downloading the data transfer when the exception occurred. [Rel: Skylink.DATA_TRANSFER_TYPE]


getPeersStateChange

  Defined in: source/skylink-events.js:1105      Available since 0.6.1

Event triggered when the retrieval of the list of rooms and peers under the same realm based on the Application Key configured in init() from the platform signaling state has changed.

Event Payload:

  • state {String}

    The retrieval current status.

  • privilegedPeerId {String}

    The Peer ID of the privileged Peer.

  • peerList {JSON}

    The retrieved list of rooms and peers under the same realm based on the Application Key configured in init().


handshakeProgress

  Defined in: source/skylink-events.js:117      Available since 0.3.0

Event triggered when a Peer connection handshake state has changed.

Event Payload:

  • step {String}

    The Peer connection handshake state. [Rel: Skylink.HANDSHAKE_PROGRESS]

  • peerId {String}

    The Peer ID associated with the connection handshake state.

  • error {Object | String} Optional

    The error object thrown when there is a failure in the connection handshaking.


iceConnectionState

  Defined in: source/skylink-events.js:157      Available since 0.1.0

Event triggered when a Peer connection ICE connection state has changed.

Event Payload:

  • state {String}

    The Peer connection ICE connection state. [Rel: Skylink.ICE_CONNECTION_STATE]

  • peerId {String}

    The Peer ID associated with the ICE connection state.


incomingData

  Defined in: source/skylink-events.js:704      Available since 0.6.1

Event triggered when a data transfer is completed in a DataChannel connection.

Event Payload:

  • data {Blob | String}

    The transferred data object.
    For Blob data object, see the createObjectURL method on how you can convert the Blob data object to a download link.

  • transferId {String}

    The transfer ID of the completed data transfer.

  • peerId {String}

    The Peer ID associated with the data transfer.

  • transferInfo {JSON}

    The transfer data object information.

    • name {String} Optional

      The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.

    • size {Number}

      The transfer data size.

    • dataType {String}

      The type of data transfer initiated. Available types are "dataURL" and "blob".

    • timeout {String}

      The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.

    • isPrivate {Boolean}

      The flag to indicate if the data transferred targeted Peer peers and not broadcasted to all Peer peers.

  • isSelf {Boolean}

    The flag that indicates if the data transfer is from self or from associated Peer.


incomingDataRequest

  Defined in: source/skylink-events.js:732      Available since 0.6.1

Event triggered when a data transfer request is made to Peer in a DataChannel connection.

Event Payload:

  • transferId {String}

    The transfer ID of the data transfer request.

  • peerId {String}

    The Peer ID associated with the data transfer request.

  • transferInfo {JSON}

    The transfer data object information.

    • name {String} Optional

      The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.

    • size {Number}

      The transfer data size.

    • dataType {String}

      The type of data transfer initiated. Available types are "dataURL" and "blob".

    • timeout {String}

      The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.

    • isPrivate {Boolean}

      The flag to indicate if the data transferred targeted Peer peers and not broadcasted to all Peer peers.

  • isSelf {Boolean}

    The flag that indicates if the data transfer request is from self or from associated Peer.


incomingMessage

  Defined in: source/skylink-events.js:613      Available since 0.5.2

Event triggered when a message is received from a Peer.

Event Payload:

  • message {JSON}

    The message object received from Peer.

    • content {JSON | String}

      The message object content. This is the message data content passed in sendMessage() and sendP2PMessage().

    • senderPeerId {String}

      The Peer ID of the peer who sent the message object.

    • targetPeerId {String | Array} Optional

      The array of targeted Peer peers or the single targeted Peer the message is targeted to received the message object. If the value is null, the message object is broadcasted to all Peer peers in the room.

    • isPrivate {Boolean}

      The flag that indicates if the message object is sent to targeted Peer peers and not broadcasted to all Peer peers.

    • isDataChannel {Boolean}

      The flag that indicates if the message object is sent from the platform signaling socket connection or P2P channel connection (DataChannel connection).

  • peerId {String}

    The Peer ID of peer who sent the message object.

  • peerInfo {Object}

    The peer information associated with the Peer Connection.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check the audioCodec configuration settings in {{#crossLink "Skylink/init:method"}}init(){{/crossLink}} to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.
    • room {String}

      The current room that the Peer is in.

  • isSelf {Boolean}

    The flag that indicates if self is the Peer.


incomingStream

  Defined in: source/skylink-events.js:531      Available since 0.5.5

Event triggered when a Stream is available from a Peer in the room.

Event Payload:

  • peerId {String}

    The Peer ID associated to the Stream object.

  • stream {Object}

    The Peer MediaStream object that is sent in this connection. To display the MediaStream object to a video or audio, simply invoke:
    attachMediaStream(domElement, stream);.

  • peerInfo {Object}

    The peer information associated with the Peer Connection.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check the audioCodec configuration settings in {{#crossLink "Skylink/init:method"}}init(){{/crossLink}} to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.
    • room {String}

      The current room that the Peer is in.

  • isSelf {Boolean}

    The flag that indicates if self is the Peer.


introduceStateChange

  Defined in: source/skylink-events.js:1120      Available since 0.6.1

Event triggered when introductory state of two Peer peers to each other selected by the privileged Peer state has changed.

Event Payload:

  • state {String}

    The Peer introduction state.

  • privilegedPeerId {String}

    The Peer ID of the privileged Peer.

  • sendingPeerId {String}

    The Peer ID of the peer that initiates the connection with the introduced Peer.

  • receivingPeerId {String}

    The Peer ID of the introduced peer who would be introduced to the initiator Peer.

  • reason {String}

    The error object thrown when there is a failure in the introduction with the two Peer peers. If received as null, it means that there is no errors.


mediaAccessError

  Defined in: source/skylink-events.js:169      Available since 0.1.0

Event triggered when Skylink fails to have access to self user media stream.

Event Payload:

  • error {Object | String}

    The error object thrown that caused the failure.

  • isScreensharing {Boolean}

    The flag that indicates if self Stream object is a screensharing stream or not.


mediaAccessRequired

  Defined in: source/skylink-events.js:196      Available since 0.5.5

Event triggered when thhe application requires to retrieve self user media stream with getUserMedia(). Once the self user media stream is attached to Skylink, the socket connection to the signaling will start and then join self to the selected room. This event will be triggered if manualGetUserMedia is set to true in joinRoom() options.


mediaAccessStopped

  Defined in: source/skylink-events.js:210      Available since 0.5.6

Event triggered when self user media stream attached to Skylink has been stopped.

Event Payload:

  • isScreensharing {Boolean}

    The flag that indicates if self Stream object is a screensharing stream or not.


mediaAccessSuccess

  Defined in: source/skylink-events.js:181      Available since 0.1.0

Event triggered when Skylink have been successfully granted access to self user media stream and attached to Skylink.

Event Payload:

  • stream {Object}

    The self user MediaStream object. To display the MediaStream object to a video or audio, simply invoke:
    attachMediaStream(domElement, stream);.

  • isScreensharing {Boolean}

    The flag that indicates if self Stream object is a screensharing stream or not.


peerConnectionState

  Defined in: source/skylink-events.js:144      Available since 0.1.0

Event triggered when a Peer connection signaling state has changed.

Event Payload:

  • state {String}

    The Peer connection signaling state. [Rel: Skylink.PEER_CONNECTION_STATE]

  • peerId {String}

    The Peer ID associated with the connection signaling state.


peerJoined

  Defined in: source/skylink-events.js:221      Available since 0.5.2

Event triggered when a Peer joins the room.

Event Payload:

  • peerId {String}

    The Peer ID of the new peer that has joined the room.

  • peerInfo {Object}

    The peer information associated with the Peer Connection.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check the audioCodec configuration settings in {{#crossLink "Skylink/init:method"}}init(){{/crossLink}} to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.
    • room {String}

      The current room that the Peer is in.

  • isSelf {Boolean}

    The flag that indicates if self is the Peer.


peerLeft

  Defined in: source/skylink-events.js:454      Available since 0.5.2

Event triggered when a Peer leaves the room.

Event Payload:

  • peerId {String}

    The Peer ID of the peer that had left the room.

  • peerInfo {Object}

    The peer information associated with the Peer Connection.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check the audioCodec configuration settings in {{#crossLink "Skylink/init:method"}}init(){{/crossLink}} to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.
    • room {String}

      The current room that the Peer is in.

  • isSelf {Boolean}

    The flag that indicates if self is the Peer.


peerRestart

  Defined in: source/skylink-events.js:298      Available since 0.5.5

Event triggered when a Peer connection has been restarted for a reconnection.

Event Payload:

  • peerId {String}

    The Peer ID of the connection that is restarted for a reconnection.

  • peerInfo {Object}

    The peer information associated with the Peer Connection.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check the audioCodec configuration settings in {{#crossLink "Skylink/init:method"}}init(){{/crossLink}} to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.
    • room {String}

      The current room that the Peer is in.

  • isSelfInitiateRestart {Boolean}

    The flag that indicates if self is the one who have initiated the Peer connection restart.


peerUpdated

  Defined in: source/skylink-events.js:377      Available since 0.5.2

Event triggered when a Peer information have been updated. This event would only be triggered if self is in the room.

Event Payload:

  • peerId {String}

    The Peer ID of the peer with updated information.

  • peerInfo {Object}

    The peer information associated with the Peer Connection.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check the audioCodec configuration settings in {{#crossLink "Skylink/init:method"}}init(){{/crossLink}} to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.
    • room {String}

      The current room that the Peer is in.

  • isSelf {Boolean}

    The flag that indicates if self is the Peer.


readyStateChange

  Defined in: source/skylink-events.js:91      Available since 0.4.0

Event triggered when Skylink is retrieving the connection information from the platform server.

Event Payload:

  • readyState {String}

    The current ready state of the retrieval when the event is triggered. [Rel: Skylink.READY_STATE_CHANGE]

  • error {JSON} Optional

    The error object thrown when there is a failure in retrieval. If received as null, it means that there is no errors.

    • status {Number}

      Http status when retrieving information. May be empty for other errors.

    • errorCode {Number}

      The READY_STATE_CHANGE_ERROR if there is an readyStateChange event error that caused the failure for initialising Skylink. [Rel: Skylink.READY_STATE_CHANGE_ERROR]

    • content {Object}

      The exception thrown that caused the failure for initialising Skylink.

  • callback.error.status {Number}

    The XMLHttpRequest status code received when exception is thrown that caused the failure for initialising Skylink.

  • room {String}

    The selected room connection information that Skylink is attempting to retrieve the information for to start connection to.


roomLock

  Defined in: source/skylink-events.js:756      Available since 0.5.2

Event triggered when the currently connected room lock status have been updated.

Event Payload:

  • isLocked {Boolean}

    The flag that indicates if the currently connected room is locked.

  • peerId {String}

    The Peer ID of the peer that updated the currently connected room lock status.

  • peerInfo {Object}

    The peer information associated with the Peer Connection.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check the audioCodec configuration settings in {{#crossLink "Skylink/init:method"}}init(){{/crossLink}} to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.
    • room {String}

      The current room that the Peer is in.

  • isSelf {Boolean}

    The flag that indicates if self is the Peer.


serverPeerJoined

  Defined in: source/skylink-events.js:906      Available since 0.6.1

Event triggered when a server Peer joins the room.

Event Payload:

  • peerId {String}

    The Peer ID of the new server peer that has joined the room.

  • serverPeerType {String}

    The server Peer type [Rel: Skylink.SERVER_PEER_TYPE]


serverPeerLeft

  Defined in: source/skylink-events.js:919      Available since 0.6.1

Event triggered when a server Peer leaves the room.

Event Payload:

  • peerId {String}

    The Peer ID of the new server peer that has left the room.

  • serverPeerType {String}

    The server Peer type [Rel: Skylink.SERVER_PEER_TYPE]


serverPeerRestart

  Defined in: source/skylink-events.js:932      Available since 0.6.1

Event triggered when a sever Peer connection has been restarted for a reconnection.

Event Payload:

  • peerId {String}

    The Peer ID of the new server peer that has joined the room.

  • serverPeerType {String}

    The server Peer type [Rel: Skylink.SERVER_PEER_TYPE]


socketError

  Defined in: source/skylink-events.js:77      Available since 0.5.5

Event triggered when Skylink has failed to establish a socket connection with the platform signaling.

Event Payload:

  • errorCode {String}

    The socket connection error code received. [Rel: Skylink.SOCKET_ERROR]

  • error {Number | String | Object}

    The error object thrown that caused the failure.

  • type {String}

    The socket transport that Skylink has failed to connect with. [Rel: Skylink.SOCKET_FALLBACK]


streamEnded

  Defined in: source/skylink-events.js:946      Available since 0.5.10

Event triggered when a Peer connection Stream streaming has stopped.

Event Payload:

  • peerId {String} Optional

    The Peer ID associated to the Stream object. If self is not in the room, the value returned would be null.

  • peerInfo {Object}

    The peer information associated with the Peer Connection.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check the audioCodec configuration settings in {{#crossLink "Skylink/init:method"}}init(){{/crossLink}} to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.
    • room {String}

      The current room that the Peer is in.

  • isSelf {Boolean}

    The flag that indicates if self is the Peer.

  • isScreensharing {Boolean}

    The flag that indicates if Peer connection Stream object is a screensharing stream or not.


streamMuted

  Defined in: source/skylink-events.js:1025      Available since 0.6.1

Event triggered when a Peer connection Stream streaming audio or video stream muted status have been updated.

Event Payload:

  • peerId {String}

    The Peer ID associated to the Stream object. If self is not in the room, the value returned would be null.

  • peerInfo {Object}

    The peer information associated with the Peer Connection.

    • userData {String | JSON}

      The custom user data information set by developer. This custom user data can also be set in setUserData().

    • settings {JSON}

      The Peer Stream streaming settings information. If both audio and video option is false, there should be no receiving remote Stream object from this associated Peer.

      • audio {Boolean | JSON} Optional
        The Peer Stream streaming audio settings. If false, it means that audio streaming is disabled in the remote Stream of the Peer.
      • audio.stereo {Boolean} Optional
        The flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check the audioCodec configuration settings in {{#crossLink "Skylink/init:method"}}init(){{/crossLink}} to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming.
      • video {Boolean | JSON} Optional
        The Peer Stream streaming video settings. If false, it means that video streaming is disabled in the remote Stream of the Peer.
      • video.resolution {JSON} Optional
        The Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Number} Optional
        The Peer Stream streaming video resolution width.
      • video.resolution.height {Number} Optional
        The Peer Stream streaming video resolution height.
      • video.frameRate {Number} Optional
        The Peer Stream streaming video maximum frameRate.
      • video.screenshare {Boolean} Optional
        The flag that indicates if the Peer connection Stream object sent is a screensharing stream or not.
      • bandwidth {String} Optional
        The Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
      • bandwidth.audio {String} Optional
        The configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s.
      • bandwidth.video {String} Optional
        The configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s.
      • bandwidth.data {String} Optional
        The configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
    • mediaStatus {JSON}

      The Peer Stream mute settings for both audio and video streamings.

      • audioMuted {Boolean} Optional
        The flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set to true.
      • videoMuted {Boolean} Optional
        The flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set to true.
    • agent {JSON}

      The Peer platform agent information.

      • name {String}
        The Peer platform browser or agent name.
      • version {Number}
        The Peer platform browser or agent version.
      • os {Number}
        The Peer platform name.
    • room {String}

      The current room that the Peer is in.

  • isSelf {Boolean}

    The flag that indicates if self is the Peer.

  • isScreensharing {Boolean}

    The flag that indicates if Peer connection Stream object is a screensharing stream or not.


systemAction

  Defined in: source/skylink-events.js:890      Available since 0.5.1

Event triggered when Skylink receives an system action from the platform signaling.

Event Payload:

  • action {String}

    The system action that is received from the platform signaling. [Rel: Skylink.SYSTEM_ACTION]

  • message {String}

    The message received from the platform signaling when the system action and reason is given.

  • reason {String}

    The reason received from the platform signaling behind the system action given. [Rel: Skylink.SYSTEM_ACTION_REASON]