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


Documentation Notes

Please refer to the init() method for a guide to initializing Skylink.
Please Note:

  • You must subscribe Skylink events before calling init().
  • You will need an API key to use Skylink, if you do not have one you can register for a developer account in the Skylink Developer Console.




  Skylink ()   _ACKProtocolHandler   _addIceCandidateFromQueue   _addIceCandidateToQueue   _addLocalMediaStreams   _addPeer   _addSDPStereo   _answerHandler   _base64ToBlob   _byeHandler   _CANCELProtocolHandler   _candidateHandler   _checkDataChannelReadyState   _chunkBlobData   _clearAllStoredLogsFn   _clearDataChannelTimeout   _closeChannel   _closeDataChannel   _condition   _createDataChannel   _createDefaultSocket   _createFallbackSocket   _createLongpollingSocket   _createPeerConnection   _createSocket   _dataChannelProtocolHandler   _DATAProtocolHandler   _doAnswer   _doOffer   _enterHandler   _ERRORProtocolHandler   _findSDPLine   _getStoredLogsFn   _initSelectedRoom   _inRoomHandler   _loadInfo   _logFn   _MESSAGEProtocolHandler   _muteAudioEventHandler   _muteLocalMediaStreams   _muteVideoEventHandler   _offerHandler   _onAddIceCandidateFailure   _onAddIceCandidateSuccess   _onIceCandidate   _onRemoteStreamAdded   _onUserMediaError   _onUserMediaSuccess   _openChannel   _parseAudioStreamSettings   _parseAudioStreamSettings   _parseBandwidthSettings   _parseDefaultMediaStreamSettings   _parseInfo   _parseMediaStreamSettings   _parseMutedSettings   _parseUserData   _printAllStoredLogsFn   _privateMessageHandler   _processingSingleMessage   _processSigMessage   _publicMessageHandler   _redirectHandler   _removePeer   _removeSDPFirefoxH264Pref   _requestServerInfo   _restartHandler   _restartPeerConnection   _roomLockEventHandler   _sendBlobDataToPeer   _sendChannelMessage   _sendDataChannelMessage   _setDataChannelTimeout   _setFirefoxIceServers   _setIceServers   _setLocalAndSendMessage   _setSDPBitrate   _setSDPVideoResolution   _startPeerConnectionHealthCheck   _stopPeerConnectionHealthCheck   _streamEventHandler   _throttle   _trigger   _updateUserEventHandler   _wait   _waitForLocalMediaStream   _waitForOpenChannel   _welcomeHandler   _WRQProtocolHandler   cancelBlobTransfer   disableAudio deprecated   disableVideo deprecated   enableAudio deprecated   enableVideo deprecated   generateUUID   getPeerInfo   getUserData   getUserMedia   init   joinRoom   leaveRoom   lockRoom   muteStream   off   on   once   refreshConnection   respondBlobRequest   sendBlobData   sendMessage   sendP2PMessage   sendStream   setDebugMode   setLogLevel   setUserData   stopStream   unlockRoom   log.debug   log.error   log.info   log.log   log.warn   SkylinkLogs.clearAllLogs   SkylinkLogs.getLogs   SkylinkLogs.printAllLogs   _apiKey   _apiKeyOwner   _audioFallback   _channelOpen   _CHUNK_FILE_SIZE   _dataChannels   _dataTransfersTimeout   _DC_PROTOCOL_TYPE   _defaultRoom   _defaultStreamSettings   _downloadDataSessions   _downloadDataTransfers   _enableDataChannel   _enableDebugMode   _enableDebugStack   _enableDebugTrace   _enableIceTrickle   _enableSTUN   _enableTURN   _EVENTS   _forceSSL   _getUserMediaSettings   _hasMCU   _ICEConnectionFailures   _key   _lastRestart   _LOG_KEY   _LOG_LEVELS   _logLevel   _mediaStreams   _mediaStreamsStatus   _MOZ_CHUNK_FILE_SIZE   _onceEvents   _path   _peerCandidatesQueue   _peerConnectionHealth   _peerConnectionHealthTimers   _peerConnections   _peerHSPriorities   _peerIceTrickleDisabled   _peerInformations   _readyState   _room   _roomCredentials   _roomDuration   _roomLocked   _roomServer   _roomStart   _selectedRoom   _serverRegion   _SIG_MESSAGE_TYPE   _signalingServer   _signalingServerPort   _signalingServerProtocol   _socket   _socketMessageQueue   _socketMessageTimeout   _socketTimeout   _socketUseXDR   _storedLogs   _streamSettings   _STUNSSL   _timestamp   _TURNSSL   _TURNTransport   _uploadDataSessions   _uploadDataTransfers   _user   _userData   CANDIDATE_GENERATION_STATE   DATA_CHANNEL_STATE   DATA_TRANSFER_DATA_TYPE   DATA_TRANSFER_STATE   DATA_TRANSFER_TYPE   HANDSHAKE_PROGRESS   ICE_CONNECTION_STATE   log   LOG_LEVEL   PEER_CONNECTION_STATE   READY_STATE_CHANGE   READY_STATE_CHANGE_ERROR   REGIONAL_SERVER   SkylinkLogs   SOCKET_ERROR   SOCKET_FALLBACK   SYSTEM_ACTION   SYSTEM_ACTION_REASON   TURN_TRANSPORT   VERSION   VIDEO_RESOLUTION   candidateGenerationState   channelClose   channelError   channelMessage   channelOpen   channelRetry   dataChannelState   dataTransferState   handshakeProgress   incomingMessage   incomingStream   mediaAccessError   mediaAccessRequired   mediaAccessStopped   mediaAccessSuccess   peerConnectionState   peerJoined   peerLeft   peerRestart   peerUpdated   readyStateChange   roomLock   socketError   systemAction
  Scroll to top

_ACKProtocolHandler

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

Handles the ACK request.

Triggers:

dataTransferState

Parameters:

  • senderPeerId {String}

    The peerId of the sender.

  • data {JSON}

    The ACK data object. [Rel: Skylink._DC_PROTOCOL_TYPE.ACK.data]

  • channelName {String}

    The DataChannel name related to the DataTransfer.


_addIceCandidateFromQueue

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

Adds all stored ICE Candidates received before handshaking.

Parameters:

  • targetMid {String}

    The peerId of the target peer.


_addIceCandidateToQueue

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

Stores an ICE Candidate received before handshaking

Parameters:

  • targetMid {String}

    The peerId of the target peer.

  • candidate {Object}

    The ICE Candidate object.


_addLocalMediaStreams

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

Sends our Local MediaStreams to other Peers. By default, it sends all it's other stream

Parameters:

  • peerId {String}

    The peerId of the peer to send local stream to.


_addPeer

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

Initiates a Peer connection with either a response to an answer or starts a connection with an offer.

Parameters:

  • targetMid {String}

    PeerId of the peer we should connect to.

  • peerBrowser {JSON}

    The peer browser information.

    • agent {String}

      The peer browser agent.

    • version {Integer}

      The peer browser version.

    • os {Integer}

      The peer operating system.

  • toOffer {Boolean} Optional
    DEFAULT: false

    Whether we should start the O/A or wait.

  • restartConn {Boolean} Optional
    DEFAULT: false

    Whether connection is restarted.

  • receiveOnly {Boolean} Optional
    DEFAULT: false

    Should they only receive?


_addSDPStereo

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

Enables the stereo feature by modifying the SDP. This requires the OPUS to be enabled in the connection first.

Parameters:

  • sdpLines {Array}

    Sdp received.

Returns:

{Array}:

Updated version with Stereo feature


_answerHandler

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

Handles the ANSWER Message event.

Triggers:

handshakeProgress

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.ANSWER.message]


_base64ToBlob

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

Converts a Base64 encoded string to a Blob.

  • Not Implemented: Handling of URLEncoded DataURIs.

Parameters:

  • dataURL {String}

    Blob base64 dataurl.


_byeHandler

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

Handles the BYTE Message event.

Triggers:

peerLeft

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.BYE.message]


_CANCELProtocolHandler

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

Handles the CANCEL request.

Triggers:

dataTransferState

Parameters:

  • senderPeerId {String}

    The peerId of the sender.

  • data {JSON}

    The CANCEL data object. [Rel: Skylink._DC_PROTOCOL_TYPE.CANCEL.data]

  • channelName {String}

    The DataChannel name related to the DataTransfer.


_candidateHandler

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

Handles the CANDIDATE Message event.

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.CANDIDATE.message]


_checkDataChannelReadyState

( dataChannel ,   callback ,   readyState ,   )
private
  Defined in: source/data-channel.js:134      Available since 0.5.5

Checks and triggers provided callback when the current DataChannel readyState is the same as the readyState provided.

Parameters:

  • dataChannel {Object}

    The DataChannel readyState to check on.

  • callback {Function}

    The callback to be fired when DataChannel readyState matches the readyState provided.

  • readyState {String}

    The DataChannel readystate to match. [Rel: DATA_CHANNEL_STATE]


_chunkBlobData

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

Chunks a Blob into Blob chunks based on a fixed size.

Parameters:

  • blob {Blob}

    The Blob data to chunk.

  • blobByteSize {Integer}

    The original Blob data size.


_clearAllStoredLogsFn

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

Gets the list of logs

Parameters:

  • logLevel {Integer} Optional

    The log level that get() should return. If not provided, it get() will return all logs from all levels. [Rel: Skylink.LOG_LEVEL]

Returns:

{Array}:

The array of logs


_clearDataChannelTimeout

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

Clears the timeout set for the DataTransfer.

Parameters:

  • peerId {String}

    The responding peerId of the peer to await for response during the DataTransfer.

  • isSender {Boolean} Optional
    DEFAULT: false

    The flag to indicate if the response received is from the sender or the receiver.


_closeChannel

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

Closes the socket signaling connection.


_closeDataChannel

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

Closes the peer's DataChannel based on the peerId provided.

Parameters:

  • peerId {String}

    The peerId associated with the DataChannel to be closed.


_condition

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

Does a check condition first to check if event is required to be subscribed. If check condition fails, it subscribes an event with once() method to wait for the condition to pass to fire the callback.

Parameters:

  • eventName {String}

    The Skylink event.

  • callback {Function}

    The callback fired after the condition is met.

  • checkFirst {Function}

    The condition to check that if pass, it would fire the callback, or it will just subscribe to an event and fire when condition is met.

  • condition {Function} Optional

    The provided condition that would trigger this event. If not provided, it will return true when the event is triggered. Return a true to fire the callback.

  • fireAlways {Boolean} Optional
    DEFAULT: false

    The function does not get removed onced triggered, but triggers everytime the event is called.


_createDataChannel

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

Creates and binds events to a SCTP DataChannel.

Triggers:

dataChannelState

Parameters:

  • peerId {String}

    The peerId to tie the DataChannel to.

  • dataChannel {Object} Optional

    The datachannel object received.

Returns:

{Object}:

New DataChannel with events.


_createDefaultSocket

()
private
  Defined in: source/socket-channel.js:361      Available since 0.5.6

Create the default socket object connection.


_createFallbackSocket

()
private
  Defined in: source/socket-channel.js:401      Available since 0.5.6

Create the fallback socket object reconnection.


_createLongpollingSocket

()
private
  Defined in: source/socket-channel.js:452      Available since 0.5.6

Create the long-polling fallback socket object reconnection.


_createPeerConnection

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

Creates a Peer connection to communicate with the peer whose ID is 'targetMid'. All the peerconnection callbacks are set up here. This is a quite central piece.

Parameters:

  • targetMid {String}

Returns:

{Object}:

The created peer connection object.


_createSocket

()
private
  Defined in: source/socket-channel.js:279      Available since 0.5.6

Create the socket object to refresh connection.


_dataChannelProtocolHandler

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

Handles the DataTransfer protocol stage and invokes the related handler function.

Parameters:

  • data {String | Object}

    The DataTransfer data received from the DataChannel.

  • senderPeerId {String}

    The peerId of the sender.

  • channelName {String}

    The DataChannel name related to the DataTransfer.


_DATAProtocolHandler

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

Handles the DATA request.

Triggers:

dataTransferState

Parameters:

  • senderPeerId {String}

    The peerId of the sender.

  • dataString {ArrayBuffer | Blob | String}

    The data received. [Rel: Skylink._DC_PROTOCOL_TYPE.DATA.data]

  • dataType {String}

    The data type received from datachannel. [Rel: Skylink.DATA_TRANSFER_DATA_TYPE]

  • channelName {String}

    The DataChannel name related to the DataTransfer.


_doAnswer

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

Creates an answer to Peer as a response to Peer's offer.

Parameters:

  • targetMid {String}

    PeerId of the peer to send answer to.


_doOffer

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

Creates an offer to Peer to initate Peer connection.

Parameters:

  • targetMid {String}

    PeerId of the peer to send offer to.

  • peerBrowser {JSON}

    The peer browser information.

    • agent {String}

      The peer browser agent.

    • version {Integer}

      The peer browser version.

    • os {Integer}

      The peer browser operating system.


_enterHandler

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

Handles the ENTER Message event.

Triggers:

handshakeProgress, peerJoined

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.ENTER.message]


_ERRORProtocolHandler

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

Handles the ERROR request.

Triggers:

dataTransferState

Parameters:

  • senderPeerId {String}

    The peerId of the sender.

  • data {JSON}

    The ERROR data object. [Rel: Skylink._DC_PROTOCOL_TYPE.ERROR.data]

  • channelName {String}

    The DataChannel name related to the DataTransfer.


_findSDPLine

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

Finds a line in the SDP that contains the condition string and returns it.

Parameters:

  • sdpLines {Array}

    Sdp received.

  • condition {Array}

    Return if one of the conditions satisfies.

Returns:

{Array}:

[index, line] - Returns the sdpLines based on the condition


_getStoredLogsFn

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

Gets the list of logs

Parameters:

  • logLevel {Integer} Optional

    The log level that get() should return. If not provided, it get() will return all logs from all levels. [Rel: Skylink.LOG_LEVEL]

Returns:

{Array}:

The array of logs


_initSelectedRoom

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

Initialize Skylink to retrieve new connection information based on options.

Triggers:

readyStateChange

Parameters:

  • room {String} Optional
    DEFAULT: Skylink._defaultRoom

    The room to connect to.

  • callback {Function}

    The callback fired once Skylink is re-initialized.


_inRoomHandler

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

Handles the IN_ROOM Message event.

Triggers:

peerJoined

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.IN_ROOM.message]


_loadInfo

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

Start the loading of information from the api server.

Triggers:

readyStateChange

_logFn

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

Logs all the console information.

Parameters:

  • logLevel {String}

    The log level.

  • message {Array | String}

    The console message.

    • 0 {String}

      The targetPeerId the message is targeted to.

    • 1 {String}

      The interface the message is targeted to.

    • 2 {String | Array}

      The events the message is targeted to.

    • 3: {String}

      The log message.

  • debugObject {Object | String} Optional

    The console parameter string or object.


_MESSAGEProtocolHandler

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

Handles the MESSAGE request.

Triggers:

incomingMessage

Parameters:

  • senderPeerId {String}

    The peerId of the sender.

  • data {JSON}

    The ACK data object. [Rel: Skylink._DC_PROTOCOL_TYPE.MESSAGE.data]

  • channelName {String}

    The DataChannel name related to the DataTransfer.


_muteAudioEventHandler

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

Handles the MUTE_AUDIO Message event.

Triggers:

peerUpdated

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.MUTE_AUDIO.message]


_muteLocalMediaStreams

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

Handles the muting of audio and video streams.

Returns:

options.hasVideoTracks If MediaStream(s) has video tracks.


_muteVideoEventHandler

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

Handles the MUTE_VIDEO Message event.

Triggers:

peerUpdated

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.MUTE_VIDEO.message]


_offerHandler

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

Handles the OFFER Message event.

Triggers:

handshakeProgress

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.OFFER.messa]


_onAddIceCandidateFailure

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

Handles the event when adding ICE Candidate fails.


_onAddIceCandidateSuccess

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

Handles the event when adding ICE Candidate passes.


_onIceCandidate

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

An ICE candidate has just been generated (ICE gathering) and will be sent to the peer. Part of connection establishment.

Triggers:

candidateGenerationState

Parameters:

  • targetMid {String}

    The peerId of the target peer.

  • event {Event}

    This is provided directly by the peerconnection API.


_onRemoteStreamAdded

( targetMid ,   event ,   )
private
  Defined in: source/stream-media.js:332      Available since 0.5.2

The remote peer advertised streams, that we are forwarding to the app. This is part of the peerConnection's addRemoteDescription() API's callback.

Triggers:

incomingStream

Parameters:

  • targetMid {String}

    PeerId of the peer that has remote stream to send.

  • event {Event}

    This is provided directly by the peerconnection API.


_onUserMediaError

( error ,   )
private
  Defined in: source/stream-media.js:298      Available since 0.5.4

Access to user's MediaStream failed.

Triggers:

mediaAccessError

Parameters:

  • error {Object}

    Error object that was thrown.


_onUserMediaSuccess

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

Access to user's MediaStream is successful.

Triggers:

mediaAccessSuccess

Parameters:

  • stream {MediaStream}

    MediaStream object.


_openChannel

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

Initiate a socket signaling connection.

Triggers:

channelMessage, channelOpen, channelError, channelClose

_parseAudioStreamSettings

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

Parse stream settings

Parameters:

  • options {Boolean | JSON} Optional
    DEFAULT: false

    This call requires audio

    • stereo {Boolean} Optional

      Enabled stereo or not.

Returns:

{JSON}:

The parsed audio options.

  • settings: User set audio options
  • userMedia: getUserMedia options

_parseAudioStreamSettings

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

Parse stream settings

Parameters:

  • options {Boolean | JSON} Optional
    DEFAULT: false

    This call requires video

    • resolution {JSON} Optional

      [Rel: Skylink.VIDEO_RESOLUTION]

      • width {Integer} Optional
        Video width
      • height {Integer} Optional
        Video height
    • frameRate {Integer} Optional

      Maximum frameRate of Video

Returns:

{JSON}:

The parsed video options.

  • settings: User set video options
  • userMedia: getUserMedia options

_parseBandwidthSettings

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

Parse and set bandwidth settings.

Parameters:

  • options {String} Optional

    Bandwidth settings

    • audio {String} Optional
      DEFAULT: 50

      Audio Bandwidth

    • video {String} Optional
      DEFAULT: 256

      Video Bandwidth

    • data {String} Optional
      DEFAULT: 1638400

      Data Bandwidth


_parseDefaultMediaStreamSettings

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

Parse stream default settings

Parameters:

  • options {JSON}

    Media default Constraints.

    • maxWidth {Boolean | JSON} Optional
      DEFAULT: 640

      Video default width.

    • maxHeight {Boolean} Optional
      DEFAULT: 480

      Video default height.


_parseInfo

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

Parse the information received from the api server.

Triggers:

readyStateChange

Parameters:

  • info {JSON}

    The parsed information from the server.


_parseMediaStreamSettings

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

Parse stream settings

Parameters:

  • options {JSON}

    Media Constraints.

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      This call requires audio

      • stereo {Boolean} Optional
        Enabled stereo or not.
      • mute {Boolean} Optional
        DEFAULT: false If audio stream should be muted.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      This call requires video

      • resolution {JSON} Optional
        [Rel: VIDEO_RESOLUTION]
      • resolution.width {Integer} Optional
        Video width
      • resolution.height {Integer} Optional
        Video height
      • frameRate {Integer} Optional
        Maximum frameRate of video.
      • mute {Boolean} Optional
        DEFAULT: false If video stream should be muted.

_parseMutedSettings

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

Parse stream settings

Parameters:

  • options {JSON}

    Media Constraints.

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      This call requires audio

      • stereo {Boolean} Optional
        Enabled stereo or not.
      • mute {Boolean} Optional
        DEFAULT: false If audio stream should be muted.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      This call requires video

      • resolution {JSON} Optional
        [Rel: VIDEO_RESOLUTION]
      • resolution.width {Integer} Optional
        Video width
      • resolution.height {Integer} Optional
        Video height
      • frameRate {Integer} Optional
        Maximum frameRate of video.
      • mute {Boolean} Optional
        DEFAULT: false If video stream should be muted.

Returns:

{JSON}:

The parsed muted options.


_parseUserData

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

Gets the Peer information (media settings,media status and personnal data set by the peer).

Parameters:

  • userData {JSON} Optional

    User custom data.


_printAllStoredLogsFn

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

Print out all the store logs in console.


_privateMessageHandler

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

Handles the PRIVATE_MESSAGE Message event.

Triggers:

privateMessage

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.PRIVATE_MESSAGE.message]


_processingSingleMessage

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

Handles the single signaling message received.

Parameters:

  • message {JSON}

    The message object received.


_processSigMessage

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

Handles every incoming signaling message received.

Parameters:

  • messageString {String}

    The message object stringified received.


_publicMessageHandler

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

Handles the PUBLIC_MESSAGE Message event.

Triggers:

publicMessage

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.PUBLIC_MESSAGE.message]


_redirectHandler

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

Handles the REDIRECT Message event.

Triggers:

systemAction

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.REDIRECT.message]


_removePeer

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

Removes and closes a Peer connection.

Triggers:

peerLeft

Parameters:

  • peerId {String}

    PeerId of the peer to close connection.


_removeSDPFirefoxH264Pref

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

Removes Firefox 32 H262 preference in the SDP to prevent breaking connection in unsupported browsers.

Parameters:

  • sdpLines {Array}

    The session description received.

Returns:

{Array}:

Updated session description.


_requestServerInfo

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

Gets information from api server.

Parameters:

  • method {String}

    The http method.

  • url {String}

    The url to do a rest call.

  • callback {Function}

    The callback fired after Skylink receives a response from the api server.

  • params {JSON}

    HTTP Params


_restartHandler

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

Handles the RESTART Message event.

Triggers:

handshakeProgress, peerRestart

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.RESTART.message]


_restartPeerConnection

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

Restarts a Peer connection.

Parameters:

  • peerId {String}

    PeerId of the peer to restart connection with.

  • isSelfInitiatedRestart {Boolean}

    Indicates whether the restarting action was caused by self.

  • isConnectionRestart {Boolean}

    The flag that indicates whether the restarting action is caused by connectivity issues.

  • callback {Function} Optional

    The callback once restart peer connection is completed.


_roomLockEventHandler

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

Handles the ROOM_LOCK Message event.

Triggers:

roomLock

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.ROOM_LOCK.message]


_sendBlobDataToPeer

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

Initiates a DataTransfer with the peer.

Parameters:

  • data {Blob}

    The Blob data to send.

    • target {Boolean}

      The real peerId to send data to, in the case where MCU is enabled.

  • dataInfo {JSON}

    The Blob data information.

    • transferId {String}

      The transferId of the DataTransfer.

    • name {String}

      The Blob data name.

    • timeout {Integer} Optional
      DEFAULT: 60

      The timeout set to await for response from peer.

    • size {Integer}

      The Blob data size.

  • targetPeerId {String} Optional

    The peerId of the peer to start the DataTransfer. To start the DataTransfer to all peers, set as false.

  • isPrivate {Boolean}

    The flag to indicate if the DataTransfer is broadcasted to other peers or sent to the peer privately.


_sendChannelMessage

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

Sends a message to the signaling server.

  • Not to be confused with method sendMessage() that broadcasts messages. This is for sending socket messages.

Parameters:

  • message {JSON}

_sendDataChannelMessage

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

Sends a Message via the peer's DataChannel based on the peerId provided.

Triggers:

dataChannelState

Parameters:

  • peerId {String}

    The peerId associated with the DataChannel to send from.

  • data {JSON}

    The Message data to send.


_setDataChannelTimeout

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

Sets a waiting timeout for the request received from the peer. Once timeout has expired, an error would be thrown.

Parameters:

  • peerId {String}

    The responding peerId of the peer to await for response during the DataTransfer.

  • timeout {Integer}

    The timeout to set in seconds.

  • isSender {Boolean} Optional
    DEFAULT: false

    The flag to indicate if the response received is from the sender or the receiver.


_setFirefoxIceServers

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

Sets the STUN server specifically for Firefox ICE Connection.

Parameters:

  • config {JSON}

    Ice configuration servers url object.

Returns:

{JSON}:

Updated configuration


_setIceServers

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

Sets the STUN server specially for Firefox for ICE Connection.

Parameters:

  • config {JSON}

    Ice configuration servers url object.

Returns:

{JSON}:

Updated configuration


_setLocalAndSendMessage

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

Sets a generated session description and sends to Peer.

Triggers:

handshakeProgress

Parameters:

  • targetMid {String}

    PeerId of the peer to send offer/answer to.

  • sessionDescription {JSON}

    This should be provided by the peerconnection API. User might 'tamper' with it, but then , the setLocal may fail.


_setSDPBitrate

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

Set the audio, video and data streamming bandwidth by modifying the SDP. It sets the bandwidth when the connection is good. In low bandwidth environment, the bandwidth is managed by the browser.

Parameters:

  • sdpLines {Array}

    The session description received.

Returns:

{Array}:

Updated session description.


_setSDPVideoResolution

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

Sets the video resolution by modifying the SDP.

  • This is broken.

Parameters:

  • sdpLines {Array}

    Sdp received.

Returns:

{Array}:

Updated version with custom Resolution settings


_startPeerConnectionHealthCheck

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

Starts a Peer connection health check. The health timers waits for connection, and within 1m if there is not connection, it attempts a reconnection.

Parameters:

  • peerId {String}

    The peerId of the peer to set a connection timeout if connection failed.

  • toOffer {Boolean}

    The flag to check if peer is offerer. If the peer is offerer, the restart check should be increased.


_stopPeerConnectionHealthCheck

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

Stops a Peer connection health check.

Parameters:

  • peerId {String}

    The peerId of the peer to clear the checking.


_streamEventHandler

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

Handles the STREAM Message event.

Triggers:

peerUpdated

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.STREAM.message]


_throttle

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

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

Parameters:

  • func {Function}

    The function that should be throttled.

  • wait {Integer}

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


_trigger

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

Trigger all the callbacks associated with an event.

  • Note that extra arguments can be passed to the callback which extra argument can be expected by callback is documented by each event.

Parameters:

  • eventName {String}

    The Skylink event.


_updateUserEventHandler

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

Handles the UPDATE_USER Message event.

Triggers:

peerUpdated

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.UPDATE_USER.message]


_wait

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

Sets an interval check. If condition is met, fires callback.

Parameters:

  • callback {Function}

    The callback fired after the condition is met.

  • condition {Function}

    The provided condition that would trigger this the callback.

  • intervalTime {Integer} Optional
    DEFAULT: 50

    The interval loop timeout.


_waitForLocalMediaStream

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

Waits for MediaStream.

  • Once the stream is loaded, callback is called
  • If there's not a need for stream, callback is called

Triggers:

mediaAccessRequired

Parameters:

  • callback {Function}

    Callback after requested constraints are loaded.

  • options {JSON} Optional

    Media Constraints.

    • userData {JSON} Optional

      User custom data.

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      This call requires audio

      • stereo {Boolean} Optional
        Enabled stereo or not
      • mute {Boolean} Optional
        DEFAULT: false If audio stream should be muted.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      This call requires video

      • resolution {JSON} Optional
        [Rel: VIDEO_RESOLUTION]
      • resolution.width {Integer} Optional
        Video width
      • resolution.height {Integer} Optional
        Video height
      • frameRate {Integer} Optional
        Maximum frameRate of Video
      • mute {Boolean} Optional
        DEFAULT: false If video stream should be muted.
    • bandwidth {String} Optional

      Bandwidth settings

      • audio {String} Optional
        Audio Bandwidth
      • video {String} Optional
        Video Bandwidth
      • data {String} Optional
        Data Bandwidth

_waitForOpenChannel

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

Waits for room to ready, before starting the Room connection.

Triggers:

peerJoined, incomingStream, mediaAccessRequired

Parameters:

  • options {JSON} Optional

    Media Constraints.

    • userData {JSON | String} Optional

      User custom data.

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      This call requires audio stream.

      • stereo {Boolean} Optional
        Option to enable stereo during call.
      • mute {Boolean} Optional
        DEFAULT: false If audio stream should be muted.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      This call requires video stream.

      • resolution {JSON} Optional
        The resolution of video stream.
      • resolution.width {Integer} Optional
        The video stream resolution width.
      • resolution.height {Integer} Optional
        The video stream resolution height.
      • frameRate {Integer} Optional
        The video stream maximum frameRate.
      • mute {Boolean} Optional
        DEFAULT: false If video stream should be muted.
    • bandwidth {JSON} Optional

      Stream bandwidth settings.

      • audio {Integer} Optional
        Audio stream bandwidth in kbps. Recommended: 50 kbps.
      • video {Integer} Optional
        Video stream bandwidth in kbps. Recommended: 256 kbps.
      • data {Integer} Optional
        Data stream bandwidth in kbps. Recommended: 1638400 kbps.

_welcomeHandler

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

Handles the WELCOME Message event.

Triggers:

handshakeProgress, peerJoined

Parameters:

  • message {JSON}

    The Message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.WELCOME.message]


_WRQProtocolHandler

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

Handles the WRQ request.

Triggers:

dataTransferState

Parameters:

  • senderPeerId {String}

    The peerId of the sender.

  • data {JSON}

    The WRQ data object. [Rel: Skylink._DC_PROTOCOL_TYPE.WRQ.data]

  • channelName {String}

    The DataChannel name related to the DataTransfer.


cancelBlobTransfer

( [peerId] ,   [transferType] ,   )
  Defined in: source/data-transfer.js:907      Available since 0.5.7

Cancels or terminates an ongoing DataTransfer request.

Triggers:

dataTransferState.

Parameters:

  • peerId {String} Optional

    The peerId of the peer associated with the DataTransfer to cancel.

  • transferType {String} Optional

    The transfer type of the request. Is it an ongoing uploading stream to reject or an downloading stream. If not transfer type is provided, it cancels all DataTransfer associated with the peer. [Rel: Skylink.DATA_TRANSFER_TYPE]


disableAudio

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

Disable microphone.

  • Try to disable the microphone.
  • If no microphone was initially set, this function has no effect.

Triggers:

peerUpdated, peerRestart

Example:

        

SkylinkDemo.disableAudio();


disableVideo

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

Disable video source.

  • Try to disable the video source.
  • If no video source was initially set, this function has no effect.

Triggers:

peerUpdated, peerRestart

Example:

        

SkylinkDemo.disableVideo();


enableAudio

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

Enable microphone.

  • Try to start the audio source.
  • If no audio source was initialy set, this function has no effect.
  • If you want to activate your audio but haven't initially enabled it you would need to reinitiate your connection with joinRoom() process and set the audio parameter to true.

Triggers:

peerUpdated, peerRestart

Example:

        

SkylinkDemo.enableAudio();


enableVideo

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

Enable webcam video.

  • Try to start the video source.
  • If no video source was initialy set, this function has no effect.
  • If you want to activate your video but haven't initially enabled it you would need to reinitiate your connection with joinRoom() process and set the video parameter to true.

Triggers:

peerUpdated, peerRestart

Example:

        

SkylinkDemo.enableVideo();


generateUUID

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

Helper function to generate unique IDs for your application.

Returns:

{String}:

The unique Id.


getPeerInfo

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

Gets the Peer information.

  • If there is no information related to the peer, null would be returned.

Parameters:

  • peerId {String} Optional

    The peerId of the peer retrieve we want to retrieve the information. Leave this blank to return the User information.

Returns:

{JSON}:

Peer information. Please reference peerJoined peerInfo parameter.

Example:

        

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

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


getUserData

()
  Defined in: source/peer-data.js:90      Available since 0.5.6

Gets the User custom data. See setUserData() for more information

Returns:

{JSON | String}:

User custom data.

Example:

        

var userInfo = SkylinkDemo.getUserData();


getUserMedia

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

Gets the default video source and microphone source.

  • This is an implemented function for Skylink.
  • Constraints are not the same as the MediaStreamConstraints specified in the w3c specs.
  • Calling getUserMedia while having streams being sent to another peer may actually cause problems, because currently getUserMedia refreshes all streams.

Triggers:

mediaAccessSuccess, mediaAccessError, streamEnded

Parameters:

  • options {JSON} Optional

    MediaStream constraints.

    • audio {JSON | Boolean} Optional
      DEFAULT: true

      Option to allow audio stream.

      • stereo {Boolean} Optional
        Option to enable stereo during call.
      • mute {Boolean} Optional
        DEFAULT: false If audio stream should be muted.
    • video {JSON | Boolean} Optional
      DEFAULT: true

      Option to allow video stream.

      • resolution {JSON} Optional
        The resolution of video stream. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Integer} Optional
        The video stream resolution width (in px).
      • resolution.height {Integer} Optional
        The video stream resolution height (in px).
      • frameRate {Integer} Optional
        The video stream maximum frameRate.
      • mute {Boolean} Optional
        DEFAULT: false If video stream should be muted.
  • callback {Function} Optional

    The callback fired after media was successfully accessed. Default signature: function(error object, success object)

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:531      Available since 0.5.5

Initialize Skylink to retrieve connection information. This is the first method to invoke before using any of Skylink functionalities.

  • Credentials parsing is not usabel.

Triggers:

readyStateChange

Parameters:

  • options {String | JSON}

    Connection options or API Key ID

    • apiKey {String}

      API Key ID to identify with the Temasys backend server

    • defaultRoom {String} Optional

      The default room to connect to if there is no room provided in joinRoom().

    • roomServer {String} Optional

      Path to the Temasys backend server. If there's no room provided, default room would be used.

    • region {String} Optional

      The regional server that user chooses to use. [Rel: Skylink.REGIONAL_SERVER]

    • enableIceTrickle {Boolean} Optional
      DEFAULT: true

      The option to enable ICE trickle or not.

    • enableDataChannel {Boolean} Optional
      DEFAULT: true

      The option to enable enableDataChannel or not.

    • enableTURNServer {Boolean} Optional
      DEFAULT: true

      To enable TURN servers in ice connection. Please do so at your own risk as it might disrupt the connection.

    • enableSTUNServer {Boolean} Optional
      DEFAULT: true

      To enable STUN servers in ice connection. Please do so at your own risk as it might disrupt the connection.

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

      Transport to set the transport packet type. [Rel: Skylink.TURN_TRANSPORT]

    • credentials {JSON} Optional

      Credentials options for setting a static meeting.

      • startDateTime {String}
        The start timing of the meeting in Date ISO String
      • duration {Integer}
        The duration of the meeting
      • credentials {String}
        The credentials required to set the timing and duration of a meeting.
    • audioFallback {Boolean} Optional
      DEFAULT: false

      To allow the option to fallback to audio if failed retrieving video stream.

    • forceSSL {Boolean} Optional
      DEFAULT: false

      To force SSL connections to the API server and signaling server.

    • socketTimeout {Integer} Optional
      DEFAULT: 20000

      To set the timeout for socket to fail and attempt a reconnection. The mininum value is 5000.

  • callback {Function} Optional

    The callback fired after the room was initialized. Default signature: function(error object, success object)

Example:

        

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

// Example 2: To initialize with apikey, roomServer and defaultRoom SkylinkDemo.init({ 'apiKey' : 'apiKey', 'roomServer' : 'http://xxxx.com', '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({ 'apiKey' : 'apiKey', 'roomServer' : 'http://xxxx.com', 'defaultRoom' : 'mainHangout' 'credentials' : { 'startDateTime' : (new Date()).toISOString(), 'duration' : 500, 'credentials' : credentials } });

// Example 4: To initialize with callback SkylinkDemo.init('apiKey',function(error,success){ if (error){ console.log('Init failed: '+JSON.stringify(error)); } else{ console.log('Init succeed: '+JSON.stringify(success)); } });


joinRoom

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

Connects the User to a Room.

Triggers:

peerJoined, mediaAccessRequired

Parameters:

  • room {String} Optional
    DEFAULT: init.options.defaultRoom

    Room name to join. If Room name is not provided, User would join the default room.

  • options {JSON} Optional

    Media Constraints

    • userData {JSON | String} Optional

      User custom data. See setUserData() for more information

    • audio {Boolean | JSON} Optional
      DEFAULT: false

      Enable audio stream.

      • stereo {Boolean} Optional
        Option to enable stereo during call.
      • mute {Boolean} Optional
        DEFAULT: false If audio stream should be muted.
    • video {Boolean | JSON} Optional
      DEFAULT: false

      Enable video stream.

      • resolution {JSON} Optional
        The resolution of video stream. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Integer} Optional
        The video stream resolution width (in px).
      • resolution.height {Integer} Optional
        The video stream resolution height (in px).
      • frameRate {Integer} Optional
        The video stream frameRate.
      • mute {Boolean} Optional
        DEFAULT: false If audio stream should be muted.
    • bandwidth {JSON} Optional

      Stream bandwidth settings.

      • audio {Integer} Optional
        DEFAULT: 50 Audio stream bandwidth in kbps.
      • video {Integer} Optional
        DEFAULT: 256 Video stream bandwidth in kbps.
      • data {Integer} Optional
        DEFAULT: 1638400 Data stream bandwidth in kbps.
    • manualGetUserMedia {Boolean} Optional

      Get the user media manually.

  • callback {Function} Optional

    The callback fired after peer leaves the room. Default signature: function(error object, success object)

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');

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

// Example 4: Join a room with prefixed video width and height settings SkylinkDemo.joinRoom('room', { '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' : { 'res' : 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

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

Disconnects a User from the room.

Triggers:

peerLeft, channelClose, streamEnded

Parameters:

  • callback {Function} Optional

    The callback fired after peer leaves the room. Default signature: function(error object, success object)

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:405      Available since 0.5.0

Locks the room to prevent other Peers from joining the room.

Triggers:

lockRoom

Example:

        

SkylinkDemo.lockRoom();


muteStream

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

Mutes a Local MediaStreams.

Triggers:

peerRestart, peerUpdated, incomingStream

Parameters:

  • options {Object | JSON}

    The muted options.

    • audioMuted {Boolean} Optional
      DEFAULT: true

      If send a new stream with audio muted.

    • videoMuted {Boolean} Optional
      DEFAULT: true

      If send a new stream with video muted.

    • getEmptyStream {Boolean} Optional
      DEFAULT: false

      If audio or video muted is set and there is no audio or video stream, it will get the stream before muting it.

Example:

        

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


off

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

To unregister a callback function from an event.

Parameters:

  • eventName {String}

    The Skylink event. See the event list to see what you can unregister.

  • callback {Function}

    The callback fired after the event is triggered. Not providing any callback turns all callbacks tied to that event off.

Example:

        

SkylinkDemo.off('peerJoined', callback);


on

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

To register a callback function to an event.

Parameters:

  • eventName {String}

    The Skylink event. See the event list to see what you can register.

  • callback {Function}

    The callback fired after the event 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:598      Available since 0.5.4

To register a callback function to an event that is fired once a condition is met.

Parameters:

  • eventName {String}

    The Skylink event. See the event list to see what you can register.

  • callback {Function}

    The callback fired after the event is triggered.

  • condition {Function} Optional

    The provided condition that would trigger this event. If not provided, it will return true when the event is triggered. Return a true to fire the callback.

  • fireAlways {Boolean} Optional
    DEFAULT: false

    The function does not get removed onced triggered, but triggers everytime the event is called.

Example:

        

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


refreshConnection

( [peerId] ,   )
  Defined in: source/peer-connection.js:396      Available since 0.5.5

Refreshes a Peer connection with a connected peer. 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.

Parameters:

  • peerId {String} Optional

    The peerId of the peer to refresh the connection.

Example:

        

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


respondBlobRequest

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

Responds to a DataTransfer request initiated by a peer.

Triggers:

dataTransferState

Parameters:

  • peerId {String} Optional

    The peerId of the peer to respond the request to.

  • accept {Boolean} Optional
    DEFAULT: false

    The flag to accept or reject the request.


sendBlobData

( data ,   dataInfo ,   [targetPeerId] ,   [callback] ,   )
  Defined in: source/data-transfer.js:688      Available since 0.5.5

Starts a DataTransfer request to the peers based on the peerIds provided. Peers have the option to accept or reject the receiving data. DataTransfers are encrypted.

Triggers:

dataTransferState

Parameters:

  • data {Object}

    The Blob data to be sent over.

  • dataInfo {JSON}

    Information required about the data transferred

    • name {String}

      The request name (name of the file for example).

    • timeout {Integer} Optional
      DEFAULT: 60

      The time (in seconds) before the transfer request is cancelled if not answered.

    • size {Integer}

      The Blob data size (in bytes).

  • targetPeerId {String} Optional

    The peerId of the peer targeted to receive data. To send to all peers, leave this option blank.

  • callback {Function} Optional

    The callback fired after data was uploaded.

    • error {Object} Optional

      The error received in the callback.

    • success {Object} Optional

      The result received in the callback.

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.log('Error happened. Can not send file')); } else{ console.log('Successfully uploaded file'); } });


sendMessage

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

Sends Message object to either a targeted Peer or Broadcasts to all Peers connected in the Room.

  • Message is sent using websockets, we don't ensure protection of your message content with this method. Prefer using sendP2PMessage().

Triggers:

incomingMessage

Parameters:

  • message {String | JSON}

    The message data to send.

  • targetPeerId {String} Optional

    PeerId of the peer to send a private message data to. If not specified then send to all peers.

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:978      Available since 0.5.5

Send a Message object via the DataChannel established with peers.

  • Maximum size: 16Kb

Triggers:

incomingMessage

Parameters:

  • message {String | JSON}

    The Message object to send.

  • targetPeerId {String} Optional

    The peerId of the targeted peer to send the Message object only. To send to all peers, leave this option blank.

Example:

        

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

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


sendStream

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

Resends a Local MediaStreams. This overrides all previous MediaStreams sent. Provided MediaStream would be automatically detected as unmuted by default.

Triggers:

peerRestart, incomingStream

Parameters:

  • stream {Object | JSON}

    The stream object or options.

    • audio {Boolean} Optional
      DEFAULT: false

      If send a new stream with audio.

      • stereo {Boolean} Optional
        Option to enable stereo during call.
      • mute {Boolean} Optional
        DEFAULT: false If send a new stream with audio muted.
    • video {JSON | Boolean} Optional
      DEFAULT: false

      Option to allow video stream.

      • resolution {JSON} Optional
        The resolution of video stream. [Rel: Skylink.VIDEO_RESOLUTION]
      • resolution.width {Integer} Optional
        The video stream resolution width (in px).
      • resolution.height {Integer} Optional
        The video stream resolution height (in px).
      • frameRate {Integer} Optional
        The video stream maximum frameRate.
      • mute {Boolean} Optional
        DEFAULT: false If send a new stream with video muted.
  • callback {Function} Optional

    The callback fired after stream was sent. Default signature: function(error object, success object)

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); } });


setDebugMode

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

Sets Skylink in debugging mode to display log stack trace.

  • By default, debugging mode is turned off.

Parameters:

  • options {Boolean | JSON} Optional
    DEFAULT: false

    Is debugging mode enabled.

    • trace {Boolean} Optional
      DEFAULT: false

      If console output should trace.

    • storeLogs {Boolean} Optional
      DEFAULT: false

      If SkylinkLogs should store the output logs.

Example:

        

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

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


setLogLevel

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

Sets the debugging log level. A log level displays logs of his level and higher: ERROR > WARN > INFO > LOG > DEBUG.

  • The default log level is Skylink.LOG_LEVEL.WARN

Parameters:

  • logLevel {Integer} Optional

    The log level.[Rel: Skylink.Data.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:41      Available since 0.5.5

Update/Set the User custom data. This Data can be a simple string or a JSON data. It is let to user choice to decide how this information must be handled. The Skylink demos provided use this parameter as a string for displaying user name.

  • Please note that the custom data would be totally overwritten.
  • If you want to modify only some data, please call getUserData() and then modify the information you want individually.
  • peerUpdated event fires only if setUserData() is called after joining a room.

Triggers:

peerUpdated

Parameters:

  • userData {JSON | String}

    User custom data.

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);


stopStream

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

Stops all MediaStreams(s) playback and streaming.


unlockRoom

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

Unlocks the room to allow other Peers to join the room.

Triggers:

lockRoom

Example:

        

SkylinkDemo.unlockRoom();


log.debug

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

Outputs a debug log in the console.

Parameters:

  • message {Array | String}

    or the message

  • object {String | Object} Optional

    The log object.

Example:

        

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


log.error

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

Outputs an error log in the console.

Parameters:

  • message {Array | String}

    or the message

  • object {String | Object} Optional

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


log.info

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

Outputs an info log in the console.

Parameters:

  • message {Array | String}

    or the message

  • object {String | Object} Optional

    The log object.

Example:

        

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


log.log

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

Outputs a normal log in the console.

Parameters:

  • message {Array | String}

    or the message

  • object {String | Object} Optional

    The log object.

Example:

        

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


log.warn

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

Outputs a warning log in the console.

Parameters:

  • message {Array | String}

    or the message

  • object {String | Object} Optional

    The log object.

Example:

        

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


SkylinkLogs.clearAllLogs

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

Clear all the stored logs.


SkylinkLogs.getLogs

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

Gets the list of logs

Parameters:

  • logLevel {Integer} Optional

    The log level that getLogs() should return. If not provided, it getLogs() will return all logs from all levels. [Rel: Skylink.LOG_LEVEL]

Returns:

{Array}:

The array of logs


SkylinkLogs.printAllLogs

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

Print out all the store logs in console.


_apiKey

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

The API Key ID.


_apiKeyOwner

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

The owner's username of the apiKey.


_audioFallback

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

Fallback to audio call if audio and video is required.

Default value:

false

_channelOpen

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

The current socket opened state.


_CHUNK_FILE_SIZE

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

The size of a chunk that DataTransfer should chunk a Blob into.


_dataChannels

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

Stores the DataChannel received or created with peers.

Keys:

  • <peerId> {Object}

    The DataChannel associated with peer.


_dataTransfersTimeout

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

Stores all the setTimeout objects for each request received.


_DC_PROTOCOL_TYPE

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

The DataTransfer protocol list. The data object is an indicator of the expected parameters to be given and received.

Keys:

  • WRQ {String}

    Send to initiate a DataTransfer request.

    • data {JSON}

      Expected WRQ data object format.

      • agent {String}
        The peer's browser agent.
      • version {Integer}
        The peer's browser version.
      • name {String}
        The Blob name.
      • size {Integer}
        The Blob size.
      • chunkSize {Integer}
        The Blob chunk size expected to receive.
      • timeout {Integer}
        The timeout to wait for the packet response.
      • isPrivate {Boolean}
        The flag to indicate if the data is sent as a private request.
      • sender {String}
        The sender's peerId.
      • type {String}
        Protocol step: "WRQ".
  • ACK {String}

    Send to acknowledge the DataTransfer request.

    • data {JSON}

      Expected ACK data object format.

      • ackN {String}
        The current index of the Blob chunk array to receive from.
        • 0 The request is accepted and sender sends the first packet.
        • >0 The current packet number from Blob array being sent.
        • -1 RThe request is rejected and sender cancels the transfer.
      • sender {String}
        The sender's peerId.
      • type {String}
        Protocol step: "ACK".
    • data {Object}

      Expected DATA data object. Look at the available types in [Rel: DATA_TRANSFER_DATA_TYPE]

  • DATA {String}

    Send as the raw Blob chunk data based on the ackN received.

    • Handle the logic based on parsing the data received as JSON. If it should fail, the expected data received should be a DATA request.
  • CANCEL {String}

    Send to cancel or terminate a DataTransfer.

    • data {Array}

      CANCEL data object format.

      • name {String}
        The Blob data name.
      • content {String}
        The reason for termination.
      • sender {String}
        The sender's peerId.
      • type {String}
        Protocol step: "CANCEL".
  • ERROR {String}

    Sent when a timeout waiting for a DataTransfer response has reached its limit.

    • data {Array}

      Expected ERROR data object format.

      • name {String}
        The Blob data name.
      • content {String}
        The error message.
      • isUploadError {Boolean} Optional
        The flag to indicate if the exception is thrown from the sender or receiving peer.
      • sender {String}
        The sender's peerId.
      • type {String}
        Protocol step: "ERROR".
  • MESSAGE {String}

    Sends a Message object.

    • data {JSON}

      Expected MESSAGE data object format.

      • target {String}
        The peerId of the peer to send the Message to.
      • data {String | JSON}
        The Message object to send.
      • sender {String}
        The sender's peerId.
      • type {String}
        Protocol step: "MESSAGE".

_defaultRoom

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

The default room that the user connects to if no room is provided in joinRoom().


_defaultStreamSettings

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

The user stream settings.

Keys:

  • audio {Boolean | JSON} Optional

    If user enables audio, this is the default setting.

    • stereo {Boolean} Optional

      Enabled stereo or not

  • video {Boolean | JSON} Optional

    If user enables video, this is the default setting.

    • resolution {JSON} Optional

      [Rel: Skylink.VIDEO_RESOLUTION]

      • width {Integer} Optional
        Video width
      • height {Integer} Optional
        Video height
    • frameRate {Integer} Optional

      Maximum frameRate of Video

  • bandwidth {String}

    Bandwidth settings.

    • audio {String}

      Audio default Bandwidth

    • video {String}

      Video default Bandwidth

    • data {String}

      Data default Bandwidth.


_downloadDataSessions

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

Stores the list of DataTransfer downloading sessions.


_downloadDataTransfers

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

Stores the list of DataTransfer downloading chunks.


_enableDataChannel

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

The flag that indicates if DataChannel should be enabled.

Default value:

true

_enableDebugMode

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

The current state if debugging mode is enabled.

Default value:

false

_enableDebugStack

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

The current state if debugging mode should store the logs in SkylinkLogs.

Default value:

false

_enableDebugTrace

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

The current state if debugging mode should print the trace in every log information.

Default value:

false

_enableIceTrickle

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

The flag that indicates if ICE trickle is enabled.

Default value:

true

_enableSTUN

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

The flag that indicates if STUN server is to be used.

Default value:

true

_enableTURN

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

The flag that indicates if TURN server is to be used.

Default value:

true

_EVENTS

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

Syntactically private variables and utility functions.


_forceSSL

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

Force an SSL connection to signalling and API server.

Default value:

false

_getUserMediaSettings

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

The getUserMedia settings parsed from _streamSettings.

Keys:

  • audio {Boolean | JSON} Optional

    This call requires audio.

  • video {Boolean | JSON} Optional

    This call requires video.

    • mandatory.maxHeight {Integer} Optional

      Video maximum width.

    • mandatory.maxWidth {Integer} Optional

      Video maximum height.

    • mandatory.maxFrameRate {Integer} Optional

      Maximum frameRate of Video.

    • optional {Array} Optional

      The getUserMedia options.


_hasMCU

Attribute Type: {Boolean}
private in-development
  Defined in: source/socket-message.js:307      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 ICE connection failures.


_key

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

The received server key.


_lastRestart

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

Timestamp of the moment when last restart happened.


_LOG_KEY

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

The log key


_LOG_LEVELS

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

The list of level levels based on index.


_logLevel

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

The log level of Skylink

Default value:

Skylink.LOG_LEVEL.ERROR

_mediaStreams

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

The list of local media streams.


_mediaStreamsStatus

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

The user MediaStream(s) status.

Keys:

  • audioMuted {Boolean} Optional

    Is user's audio muted.

  • videoMuted {Boolean} Optional

    Is user's vide muted.


_MOZ_CHUNK_FILE_SIZE

Attribute Type: {Integer}
required private final
  Defined in: source/data-process.js:14      Available since 0.5.2

The size of a chunk that DataTransfer should chunk a Blob into specifically for Firefox based browsers.

  • Tested: Sends 49152 kb | Receives 16384 kb.

_onceEvents

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

Events with callbacks that would be fired only once once condition is met.


_path

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

The path that user is currently connect to.

  • NOTE ALEX: check if last char is '/'

Default value:

Skylink._serverPath

_peerCandidatesQueue

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

Stores the list of queued ICE Candidates received before handshaking is completed.


_peerConnectionHealth

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

Stores the list of stable Peer connection.


_peerConnectionHealthTimers

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

Stores the list of setTimeout awaiting for successful connection.


_peerConnections

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

Internal array of Peer connections.


_peerHSPriorities

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

Stores the list of handshaking weights received that would be compared against to indicate if User should send an "offer" or Peer should.


_peerIceTrickleDisabled

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

Stores the list of ICE Candidates to disable ICE trickle to ensure stability of ICE connection.


_peerInformations

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

Stores the User information.


_readyState

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

The current Skylink ready state change. [Rel: Skylink.READY_STATE_CHANGE]


_room

Attribute Type: {JSON}
required private
  Defined in: source/room-init.js:254      Available since 0.5.2

The room connection information.

Keys:

  • id {String}

    The roomId of the room user is connected to.

  • token {String}

    The token of the room user is connected to.

  • startDateTime {String}

    The startDateTime in ISO string format of the room.

  • duration {String}

    The duration of the room.

  • connection {JSON}

    Connection constraints and configuration.

    • peerConstraints {JSON}

      The peerconnection constraints.

    • peerConfig {JSON}

      The peerconnection configuration.

    • offerConstraints {JSON}

      The offer constraints.

    • sdpConstraints {JSON}

      The sdp constraints.


_roomCredentials

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

The credentials required to set the start date and time and the duration.


_roomDuration

Attribute Type: {Integer}
private optional
  Defined in: source/room-init.js:194      Available since 0.3.0

The static room's meeting duration.


_roomLocked

Attribute Type: {Boolean}
private
  Defined in: source/room-connection.js:65      Available since 0.5.2

The flag that indicates whether room is currently locked.


_roomServer

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

The server that user connects to to make api calls to.

  • The reason why users can input this value is to give users the chance to connect to any of our beta servers if available instead of the stable version.

Default value:

'//api.temasys.com.sg'

_roomStart

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

The static room's meeting starting date and time.

  • The value is in ISO formatted string.

_selectedRoom

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

The room that the user is currently connected to.

Default value:

Skylink._defaultRoom

_serverRegion

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

The regional server that Skylink connects to.


_SIG_MESSAGE_TYPE

Attribute Type: {JSON}
private readonly
  Defined in: source/socket-message.js:1      Available since 0.5.6

The Message protocol list. The message object is an indicator of the expected parameters to be given and received.

Keys:

  • JOIN_ROOM {String}

    Send to initiate the connection to the Room.

    • message {JSON}

      Expected JOIN_ROOM data object format.

      • rid {String}
        Received rid from API web-server.
      • uid {String}
        Received uid from API web-server.
      • cid {String}
        Received cid from API web-server.
      • userCred {String}
        Received userCred from API web-server.
      • timeStamp {String}
        Received timeStamp from API web-server.
      • apiOwner {String}
        Received apiOwner from API web-server.
      • roomCred {String}
        Received roomCred from API web-server.
      • start {String}
        Received start from API web-server.
      • len {String}
        Received duration from API web-server.
      • type {String}
        Protocol step: "joinRoom".
  • IN_ROOM {String}

    Received as a response from server that User has joined the Room.

    • message {JSON}

      Expected IN_ROOM data object format.

      • rid {String}
        The roomId of the connected room.
      • sid {String}
        The User's userId.
      • pc_config {JSON}
        The Peer connection iceServers configuration.
      • type {String}
        Protocol step: "inRoom".
  • ENTER {String}

    Broadcasts to any Peers connected to the room to intiate a Peer connection.

    • message {JSON}

      Expected ENTER data object format.

      • rid {String}
        The roomId of the connected Room.
      • mid {String}
        The sender's peerId / userId.
      • receiveOnly {Boolean} Optional
        The flag to prevent Peers from sending any Stream to the User but receive User's stream only.
      • agent {String}
        The Peer's browser agent.
      • version {String}
        The Peer's browser version.
      • userInfo {String}
        The Peer's information.
      • userInfo.settings {JSON}
        The stream settings
      • userInfo.settings.audio {Boolean | JSON} Optional
        The flag to indicate if audio is enabled in the connection or not.
      • userInfo.settings.audio.stereo {Boolean} Optional
        The flag to indiciate if stereo should be enabled in OPUS connection.
      • userInfo.settings.video {Boolean | JSON} Optional
        The flag to indicate if video is enabled in the connection or not.
      • userInfo.settings.video.resolution {JSON} Optional
        [Rel: Skylink.VIDEO_RESOLUTION] The video stream resolution.
      • userInfo.settings.video.resolution.width {Integer} Optional
        The video stream resolution width.
      • userInfo.settings.video.resolution.height {Integer} Optional
        The video stream resolution height.
      • userInfo.settings.video.frameRate {Integer} Optional
        The video stream maximum frame rate.
      • userInfo.mediaStatus {JSON}
        The Peer's Stream status. This is used to indicate if connected video or audio stream is muted.
      • userInfo.mediaStatus.audioMuted {Boolean} Optional
        The flag to indicate that the Peer's audio stream is muted or disabled.
      • userInfo.mediaStatus.videoMuted {Boolean} Optional
        The flag to indicate that the Peer's video stream is muted or disabled.
      • userInfo.userData {String | JSON}
        The custom User data.
      • type {String}
        Protocol step: "enter".
  • WELCOME {String}

    Send as a response to Peer's enter received. User starts creating offer to the Peer.

    • message {JSON}

      Expected WELCOME data object format.

      • rid {String}
        The roomId of the connected Room.
      • mid {String}
        The sender's peerId / userId.
      • receiveOnly {Boolean} Optional
        The flag to prevent Peers from sending any Stream to the User but receive User's stream only.
      • enableIceTrickle {Boolean} Optional
        The flag to forcefully enable or disable ICE Trickle for the Peer connection.
      • enableDataChannel {Boolean} Optional
        The flag to forcefully enable or disable ICE Trickle for the Peer connection.
      • agent {String}
        The Peer's browser agent.
      • version {String}
        The Peer's browser version.
      • userInfo {String}
        The Peer's information.
      • userInfo.settings {JSON}
        The stream settings
      • userInfo.settings.audio {Boolean | JSON} Optional
        The flag to indicate if audio is enabled in the connection or not.
      • userInfo.settings.audio.stereo {Boolean} Optional
        The flag to indiciate if stereo should be enabled in OPUS connection.
      • userInfo.settings.video {Boolean | JSON} Optional
        The flag to indicate if video is enabled in the connection or not.
      • userInfo.settings.video.resolution {JSON} Optional
        [Rel: Skylink.VIDEO_RESOLUTION] The video stream resolution.
      • userInfo.settings.video.resolution.width {Integer} Optional
        The video stream resolution width.
      • userInfo.settings.video.resolution.height {Integer} Optional
        The video stream resolution height.
      • userInfo.settings.video.frameRate {Integer} Optional
        The video stream maximum frame rate.
      • userInfo.mediaStatus {JSON}
        The Peer's Stream status. This is used to indicate if connected video or audio stream is muted.
      • userInfo.mediaStatus.audioMuted {Boolean} Optional
        The flag to indicate that the Peer's audio stream is muted or disabled.
      • userInfo.mediaStatus.videoMuted {Boolean} Optional
        The flag to indicate that the Peer's video stream is muted or disabled.
      • userInfo.userData {String | JSON}
        The custom User data.
      • target {String}
        The peerId of the peer to respond the enter message to.
      • weight {Integer}
        The priority weight of the message. This is required when two Peers receives each other's welcome message, hence disrupting the handshaking to be incorrect. With a generated weight usually done by invoking Date.UTC(), this would check against the received weight and generated weight for the Peer to prioritize who should create or receive the offer.
        • >=0 An ongoing weight priority check is going on.Weight priority message.
        • -1 Enforce create offer to happen without any priority weight check.
        • -2 Enforce create offer and re-creating of Peer connection to happen without any priority weight check.
      • type {String}
        Protocol step: "welcome".
  • OFFER {String}

    Send when createOffer is completed and generated.

    • message {JSON}

      Expected OFFER data object format.

      • rid {String}
        The roomId of the connected room.
      • mid {String}
        The sender's peerId.
      • sdp {String}
        The generated offer session description.
      • type {String}
        Protocol step: "offer".
  • ANSWER {String}

    Send as a response to Peer's offer Message after createAnswer is called.

    • message {JSON}

      Expected ANSWER data object format.

      • rid {String}
        The roomId of the connected room.
      • sdp {String}
        The generated answer session description.
      • mid {String}
        The sender's peerId.
      • type {String}
        Protocol step: "answer".
  • CANDIDATE {String}

    Send when an ICE Candidate is generated.

    • message {JSON}

      Expected CANDIDATE data object format.

      • rid {String}
        The roomId of the connected room.
      • mid {String}
        The sender's peerId.
      • sdp {String}
        The ICE Candidate's session description.
      • target {String}
        The peerId of the targeted Peer.
      • id {String}
        The ICE Candidate's id.
      • candidate {String}
        The ICE Candidate's candidate object.
      • label {String}
        The ICE Candidate's label.
      • type {String}
        Protocol step: "candidate".
  • BYE {String}

    Received as a response from server that a Peer has left the Room.

    • message {JSON}

      Expected BYTE data object format.

      • rid {String}
        The roomId of the connected Room.
      • mid {String}
        The peerId of the Peer that has left the Room.
      • type {String}
        Protocol step: "bye".
  • REDIRECT {String}

    Received as a warning from server when User is rejected or is jamming the server.

    • message {JSON}

      Expected REDIRECT data object format.

      • rid {String}
        The roomId of the connected Room.
      • info {String}
        The server's message.
      • action {String}
        The action that User has to take on. [Rel: Skylink.SYSTEM_ACTION]
      • reason {String}
        The reason of why the action is worked upon. [Rel: Skylink.SYSTEM_ACTION_REASON]
      • type {String}
        Protocol step: "redirect".
  • UPDATE_USER {String}

    Broadcast when a User's information is updated to reflect the the changes on Peer's end.

    • message {JSON}

      Expected UPDATE_USER data object format.

      • rid {String}
        The roomId of the connected Room.
      • mid {String}
        The sender's peerId.
      • userData {JSON | String}
        The updated User data.
      • type {String}
        Protocol step: "updateUserEvent".
  • ROOM_LOCK {String}

    Broadcast to change the Room lock status.

    • message {JSON}

      Expected ROOM_LOCK data object format.

      • rid {String}
        The roomId of the connected Room.
      • mid {String}
        The sender's peerId.
      • lock {String}
        The flag to indicate if the Room is locked or not
      • type {String}
        Protocol step: "roomLockEvent".
  • MUTE_VIDEO {String}

    Broadcast when User's video stream is muted or unmuted.

    • message {JSON}

      Expected MUTE_VIDEO data object format.

      • rid {String}
        The roomId of the connected Room.
      • mid {String}
        The sender's peerId.
      • muted {String}
        The flag to indicate if the User's video stream is muted or not.
      • type {String}
        Protocol step: "muteVideoEvent".
  • MUTE_AUDIO {String}

    Broadcast when User's audio stream is muted or unmuted.

    • message {JSON}

      Expected MUTE_AUDIO data object format.

      • rid {String}
        The roomId of the connected Room.
      • mid {String}
        The sender's peerId.
      • muted {String}
        The flag to indicate if the User's audio stream is muted or not.
      • type {String}
        Protocol step: "muteAudioEvent".
  • PUBLIC_MESSAGE {String}

    Broadcasts a Message object to all Peers in the Room.

    • message {JSON}

      Expected PUBLIC_MESSAGE data object format.

      • data {JSON | String}
        The Message object.
      • rid {String}
        The roomId of the connected Room.
      • cid {String}
        The credentialId of the connected Room.
      • mid {String}
        The sender's peerId.
      • type {String}
        Protocol step: "public".
  • PRIVATE_MESSAGE {String}

    Sends a Message object to a Peer in the Room.

    • message {JSON}

      The message object.

      • data {JSON | String}
        The Message object.
      • rid {String}
        The roomId of the connected Room.
      • cid {String}
        The credentialId of the connected Room.
      • mid {String}
        The sender's peerId.
      • target {String}
        The peerId of the targeted Peer.
      • type {String}
        Protocol step: "private".
  • RESTART {String}

    Sends when a Peer connection is restarted.

    • message {JSON}

      Expected RESTART data object format.

      • rid {String}
        The roomId of the connected Room.
      • mid {String}
        The sender's peerId / userId.
      • receiveOnly {Boolean} Optional
        The flag to prevent Peers from sending any Stream to the User but receive User's stream only.
      • enableIceTrickle {Boolean} Optional
        The flag to forcefully enable or disable ICE Trickle for the Peer connection.
      • enableDataChannel {Boolean} Optional
        The flag to forcefully enable or disable ICE Trickle for the Peer connection.
      • agent {String}
        The Peer's browser agent.
      • version {String}
        The Peer's browser version.
      • userInfo {String}
        The Peer's information.
      • userInfo.settings {JSON}
        The stream settings
      • userInfo.settings.audio {Boolean | JSON} Optional
        The flag to indicate if audio is enabled in the connection or not.
      • userInfo.settings.audio.stereo {Boolean} Optional
        The flag to indiciate if stereo should be enabled in OPUS connection.
      • userInfo.settings.video {Boolean | JSON} Optional
        The flag to indicate if video is enabled in the connection or not.
      • userInfo.settings.video.resolution {JSON} Optional
        [Rel: Skylink.VIDEO_RESOLUTION] The video stream resolution.
      • userInfo.settings.video.resolution.width {Integer} Optional
        The video stream resolution width.
      • userInfo.settings.video.resolution.height {Integer} Optional
        The video stream resolution height.
      • userInfo.settings.video.frameRate {Integer} Optional
        The video stream maximum frame rate.
      • userInfo.mediaStatus {JSON}
        The Peer's Stream status. This is used to indicate if connected video or audio stream is muted.
      • userInfo.mediaStatus.audioMuted {Boolean} Optional
        The flag to indicate that the Peer's audio stream is muted or disabled.
      • userInfo.mediaStatus.videoMuted {Boolean} Optional
        The flag to indicate that the Peer's video stream is muted or disabled.
      • userInfo.userData {String | JSON}
        The custom User data.
      • target {String}
        The peerId of the peer to respond the enter message to.
      • type {String}
        Protocol step: "restart".
  • STREAM {String}

    Broadcast when a Stream has ended. This is temporal.

    • message {JSON}

      Expected STREAM data object format.

      • rid {String}
        The roomId of the connected Room.
      • mid {String}
        The peerId of the sender.
      • status {String}
        The MediaStream status.
        • ended: MediaStream has ended
      • type {String}
        Protocol step: "stream".
  • GROUP {String}

    Messages are bundled together when messages are sent too fast to prevent server redirects over sending less than 1 second interval.

    • message {JSON}

      Expected GROUP data object format.

      • list {Array}
        The list of bundled messages.
      • list.<message> {Array}
        The Message object.
      • type {String}
        Protocol step: "group".

_signalingServer

Attribute Type: {String}
private
  Defined in: source/socket-channel.js:87      Available since 0.5.2

The signaling server to connect to.


_signalingServerPort

Attribute Type: {Integer}
private
  Defined in: source/socket-channel.js:119      Available since 0.5.4

The signaling server port to connect to.

Default value:

https: = 443, http = 80

_signalingServerProtocol

Attribute Type: {String}
private
  Defined in: source/socket-channel.js:98      Available since 0.5.4

The signaling server protocol to use.

  • https:
    • Default port is 443.
    • Fallback port is 3443.
  • http:
    • Default port is 80.
    • Fallback port is 3000.

_socket

Attribute Type: {Object}
required private
  Defined in: source/socket-channel.js:132      Available since 0.1.0

The actual socket object that handles the connection.


_socketMessageQueue

Attribute Type: {Array}
required private
  Defined in: source/socket-channel.js:28      Available since 0.5.8

The queue of messages to be sent to signaling server.


_socketMessageTimeout

Attribute Type: {Function}
required private
  Defined in: source/socket-channel.js:40      Available since 0.5.8

The timeout used to send socket message queue.


_socketTimeout

Attribute Type: {Integer}
required private
  Defined in: source/socket-channel.js:144      Available since 0.5.4

The socket connection timeout

  • 0 Uses the default timeout from socket.io 20000ms.
  • >0 Uses the user set timeout

Default value:

0

_socketUseXDR

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

The socket connection to use XDomainRequest.

Default value:

false

_storedLogs

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

An internal array of logs.


_streamSettings

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

The user stream settings.

Keys:

  • audio {Boolean | JSON} Optional

    This call requires audio

    • stereo {Boolean} Optional

      Enabled stereo or not

  • video {Boolean | JSON} Optional

    This call requires video

    • resolution {JSON} Optional

      [Rel: Skylink.VIDEO_RESOLUTION]

      • width {Integer} Optional
        Video width
      • height {Integer} Optional
        Video height
    • frameRate {Integer} Optional

      Maximum frameRate of Video

  • bandwidth {String} Optional

    Bandwidth settings

    • audio {String} Optional

      Audio Bandwidth

    • video {String} Optional

      Video Bandwidth

    • data {String} Optional

      Data Bandwidth.


_STUNSSL

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

The flag that indicates if SSL is used in STUN server connection.

Default value:

false

_timestamp

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

The timestamp for throttle function to use.


_TURNSSL

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

The flag that indicates if SSL is used in TURN server connection.

Default value:

false

_TURNTransport

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

The option of transport protocol for TURN servers.

Default value:

Skylink.TURN_TRANSPORT.ANY

_uploadDataSessions

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

Stores the list of DataTransfer uploading sessions.


_uploadDataTransfers

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

Stores the list of DataTransfer uploading chunks.


_user

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

Stores the User information, credential and the local stream(s).

Keys:

  • uid {String}

    The user's session id.

  • sid {String}

    The user's secret id. This is the id used as the peerId.

  • timestamp {String}

    The user's timestamp.

  • token {String}

    The user's access token.


_userData

Attribute Type: {JSON | String}
required private
  Defined in: source/peer-data.js:29      Available since 0.5.6

User's custom data set.


CANDIDATE_GENERATION_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/ice-candidate.js:26      Available since 0.4.1

The list of ICE candidate generation states that would be triggered.

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}
readonly
  Defined in: source/data-channel.js:1      Available since 0.1.0

The list of DataChannel states that would be trigged.

Keys:

  • CONNECTING {String}

    The DataChannel is attempting to establish a connection.

  • OPEN {String}

    The DataChannel connection is established.

  • CLOSING {String}

    The DataChannel is closing the connection.

  • CLOSED {String}

    The DataChannel connection is closed.

  • ERROR {String}

    The DataChannel is thrown with an exception during connection.


DATA_TRANSFER_DATA_TYPE

Attribute Type: {JSON}
readonly
  Defined in: source/data-process.js:29      Available since 0.1.0

The list of DataTransfer native data types that would be transfered with.

  • Not Implemented: ARRAY_BUFFER, BLOB.

Keys:

  • BINARY_STRING {String}

    BinaryString data type.

  • ARRAY_BUFFER {String}

    ArrayBuffer data type.

  • BLOB {String}

    Blob data type.


DATA_TRANSFER_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/data-transfer.js:98      Available since 0.4.0

The list of DataTransfer states that would be triggered.

Keys:

  • UPLOAD_REQUEST {String}

    A DataTransfer request to start a transfer is received.

  • UPLOAD_STARTED {String}

    The request has been accepted and upload is starting.

  • DOWNLOAD_STARTED {String}

    The request has been accepted and download is starting.

  • UPLOADING {String}

    An ongoing upload DataTransfer is occuring.

  • DOWNLOADING {String}

    An ongoing download DataTransfer is occuring.

  • UPLOAD_COMPLETED {String}

    The upload is completed.

  • DOWNLOAD_COMPLETED {String}

    The download is completed.

  • REJECTED {String}

    A DataTransfer request is rejected by a peer.

  • ERROR {String}

    DataTransfer has waiting longer than timeout is specified. DataTransfer is aborted.


DATA_TRANSFER_TYPE

Attribute Type: {JSON}
readonly
  Defined in: source/data-transfer.js:81      Available since 0.1.0

The list of DataTransfer streamming types to indicate an upload stream or download stream.

Keys:

  • UPLOAD {String}

    An upload stream.

  • DOWNLOAD {String}

    A download stream.


HANDSHAKE_PROGRESS

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

The list of handshake progress steps that would be triggered.

Keys:

  • ENTER {String}

    Step 1. Received "enter" from peer.

  • WELCOME {String}

    Step 2. Received "welcome" from peer.

  • OFFER {String}

    Step 3. Received "offer" from peer.

  • ANSWER {String}

    Step 4. Received "answer" from peer.

  • ERROR {String}

    Error state.


ICE_CONNECTION_STATE

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

The list of ICE Connection states that would be triggered.

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.


log

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

Logs all the console information.

Keys:

  • debug {Function}

    For debug mode.

  • log {Function}

    For log mode.

  • info {Function}

    For info mode.

  • warn {Function}

    For warn mode.

  • serror {Function}

    For error mode.


LOG_LEVEL

Attribute Type: {JSON}
readonly
  Defined in: source/skylink-debug.js:1      Available since 0.5.4

The log levels.

  • Order from highest to lowest is: error > warn > info > log > debug.
  • A log level displays logs of his level and higher (e.g warn level displays warn and error).

Keys:

  • DEBUG {Integer}

    Level 5. Shows debug logs.

  • LOG {Integer}

    Level 4. Shows normal logs.

  • INFO {Integer}

    Level 3. Show informational logs related to user.

  • WARN {Integer}

    Level 2. Shows warnings.

  • ERROR {Integer}

    Level 1. Shows the errors that are thrown during execution.


PEER_CONNECTION_STATE

Attribute Type: {JSON}
readonly
  Defined in: source/peer-connection.js:1      Available since 0.5.0

The list of Peer connection states that would be triggered.

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 Room initialization readyStates. This indicates if the required API information has been retrieved successfully from the API server for the signaling connection.

Keys:

  • INIT {Integer}

    The initialization state.

  • LOADING {Integer}

    The API information is retrieving in progress.

  • COMPLETED {Integer}

    The API information has been retrieved.

  • ERROR {Integer}

    An error has occurred when retrieving API information.


READY_STATE_CHANGE_ERROR

Attribute Type: {JSON}
readonly
  Defined in: source/room-init.js:23      Available since 0.4.0

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 {Integer}

    Api Key provided does not exist.

  • API_DOMAIN_NOT_MATCH {Integer}

    Api Key used in domain does not match.

  • API_CORS_DOMAIN_NOT_MATCH {Integer}

    Api Key used in CORS domain does not match.

  • API_CREDENTIALS_INVALID {Integer}

    Api Key credentials does not exist.

  • API_CREDENTIALS_NOT_MATCH {Integer}

    Api Key credentials does not match what is expected.

  • API_INVALID_PARENT_KEY {Integer}

    Api Key does not have a parent key nor is a root key.

  • API_NOT_ENOUGH_CREDIT {Integer}

    Api Key does not have enough credits to use.

  • API_NOT_ENOUGH_PREPAID_CREDIT {Integer}

    Api Key does not have enough prepaid credits to use.

  • API_FAILED_FINDING_PREPAID_CREDIT {Integer}

    Api Key preapid payments does not exist.

  • API_NO_MEETING_RECORD_FOUND {Integer}

    Api Key does not have a meeting record at this timing. This occurs when Api Key is a static one.

  • ROOM_LOCKED {Integer}

    Room is locked.

  • NO_SOCKET_IO {Integer}

    No socket.io dependency is loaded to use.

  • NO_XMLHTTPREQUEST_SUPPORT {Integer}

    Browser does not support XMLHttpRequest to use.

  • NO_WEBRTC_SUPPORT {Integer}

    Browser does not have WebRTC support.

  • NO_PATH {Integer}

    No path is loaded yet.

  • INVALID_XMLHTTPREQUEST_STATUS {Integer}

    Invalid XMLHttpRequest when retrieving information.


REGIONAL_SERVER

Attribute Type: {JSON}
readonly
  Defined in: source/room-init.js:84      Available since 0.5.0

The list of available regional servers.

  • This is for developers to set the nearest region server for Skylink to connect to for faster connectivity.
  • The available regional servers are:

Keys:

  • APAC1 {String}

    Asia pacific server 1.

  • US1 {String}

    server 1.


SkylinkLogs

Attribute Type: {JSON}
required global
  Defined in: source/skylink-debug.js:195      Available since 0.5.5

Handles the list of Skylink logs.


SOCKET_ERROR

Attribute Type: {JSON}
readonly
  Defined in: source/socket-channel.js:1      Available since 0.5.6

The list of channel connection error.

  • The errors that would occur are:

Keys:

  • CONNECTION_FAILED {Integer}

    The connection failed. Up to user's defined reconnection attempts to decide on a reconnection.

  • RECONNECTION_FAILED {String}

    The reconnection failed. Up to user's defined reconnection attempts to decide on another reconnection.

  • CONNECTION_ABORTED {String}

    No reconnection specified. Connection is aborted.

  • RECONNECTION_ABORTED {String}

    All reconnection attempts have failed. Reconnection is aborted.

  • RECONNECTION_ATTEMPT {String}

    A reconnection attempt has been fired.


SOCKET_FALLBACK

Attribute Type: {JSON}
readonly
  Defined in: source/socket-channel.js:52      Available since 0.5.6

The list of channel connection fallback states.

  • The fallback states that would occur are:

Keys:

  • NON_FALLBACK {String}

    Non-fallback state,

  • FALLBACK_PORT {String}

    Fallback to non-ssl port for channel re-try.

  • FALLBACK_PORT_SSL {String}

    Fallback to ssl port for channel re-try.

  • LONG_POLLING {String}

    Fallback to non-ssl long-polling.

  • LONG_POLLING_SSL {String}

    Fallback to ssl port for long-polling.


SYSTEM_ACTION

Attribute Type: {JSON}
readonly
  Defined in: source/room-connection.js:1      Available since 0.5.1

The list of signaling warnings that would be received.

Keys:

  • WARNING {String}

    Server warning to User if actions are not taken, User would be kicked out of the Room.

  • REJECT {String}

    Server has kicked User out of the Room.


SYSTEM_ACTION_REASON

Attribute Type: {JSON}
readonly
  Defined in: source/room-connection.js:18      Available since 0.5.2

The list of signaling actions to be taken upon received.

Keys:

  • FAST_MESSAGE {String}

    User is not alowed to send too quick messages as it is used to prevent jam.

  • ROOM_LOCKED {String}

    Room is locked and User is rejected from joining the Room.

  • ROOM_FULL {String}

    The target Peers in a persistent room is full.

  • DUPLICATED_LOGIN {String}

    The User is re-attempting to connect again with an userId that has been used.

  • SERVER_ERROR {String}

    Server has an error.

  • VERIFICATION {String}

    Verification is incomplete for roomId provided.

  • EXPIRED {String}

    Persistent meeting. Room has expired and user is unable to join the room.

  • ROOM_CLOSED {String}

    The persistent room is closed as it has been expired.

  • ROOM_CLOSING {String}

    The persistent room is closing.

  • OVER_SEAT_LIMIT {String}

    The seat limit has been reached.


TURN_TRANSPORT

Attribute Type: {JSON}
readonly
  Defined in: source/ice-connection.js:41      Available since 0.5.4

The list of TURN server transports.

Keys:

  • TCP {String}

    Use only TCP transport option.

  • UDP {String}

    Use only UDP transport option.

  • ANY {String}

    Use both TCP and UDP transport option.

  • NONE {String}

    Set no transport option in TURN servers


VERSION

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

Version of Skylink


VIDEO_RESOLUTION

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

The list of recommended video resolutions.

  • Note that the higher the resolution, the connectivity speed might be affected.
  • The available video resolutions type are:

Keys:

  • QQVGA {JSON}

    QQVGA resolution.

    • width {Integer}

      160

    • height {Integer}

      120

    • aspectRatio {String}

      4:3

  • HQVGA {JSON}

    HQVGA resolution.

    • width {Integer}

      240

    • height {Integer}

      160

    • aspectRatio {String}

      3:2

  • QVGA {JSON}

    QVGA resolution.

    • width {Integer}

      320

    • height {Integer}

      180

    • aspectRatio {String}

      4:3

  • WQVGA {JSON}

    WQVGA resolution.

    • width {Integer}

      384

    • height {Integer}

      240

    • aspectRatio {String}

      16:10

  • HVGA {JSON}

    HVGA resolution.

    • width {Integer}

      480

    • height {Integer}

      320

    • aspectRatio {String}

      3:2

  • VGA {JSON}

    VGA resolution.

    • width {Integer}

      640

    • height {Integer}

      360

    • aspectRatio {String}

      4:3

  • WVGA {JSON}

    WVGA resolution.

    • width {Integer}

      768

    • height {Integer}

      480

    • aspectRatio {String}

      16:10

  • FWVGA {JSON}

    FWVGA resolution.

    • width {Integer}

      854

    • height {Integer}

      480

    • aspectRatio {String}

      16:9

  • SVGA {JSON}

    SVGA resolution.

    • width {Integer}

      800

    • height {Integer}

      600

    • aspectRatio {String}

      4:3

  • DVGA {JSON}

    DVGA resolution.

    • width {Integer}

      960

    • height {Integer}

      640

    • aspectRatio {String}

      3:2

  • WSVGA {JSON}

    WSVGA resolution.

    • width {Integer}

      1024

    • height {Integer}

      576

    • aspectRatio {String}

      16:9

  • HD {JSON}

    HD resolution.

    • width {Integer}

      1280

    • height {Integer}

      720

    • aspectRatio {String}

      16:9

  • HDPLUS {JSON}

    HDPLUS resolution.

    • width {Integer}

      1600

    • height {Integer}

      900

    • aspectRatio {String}

      16:9

  • FHD {JSON}

    FHD resolution.

    • width {Integer}

      1920

    • height {Integer}

      1080

    • aspectRatio {String}

      16:9

  • QHD {JSON}

    QHD resolution.

    • width {Integer}

      2560

    • height {Integer}

      1440

    • aspectRatio {String}

      16:9

  • WQXGAPLUS {JSON}

    WQXGAPLUS resolution.

    • width {Integer}

      3200

    • height {Integer}

      1800

    • aspectRatio {String}

      16:9

  • UHD {JSON}

    UHD resolution.

    • width {Integer}

      3840

    • height {Integer}

      2160

    • aspectRatio {String}

      16:9

  • UHDPLUS {JSON}

    UHDPLUS resolution.

    • width {Integer}

      5120

    • height {Integer}

      2880

    • aspectRatio {String}

      16:9

  • FUHD {JSON}

    FUHD resolution.

    • width {Integer}

      7680

    • height {Integer}

      4320

    • aspectRatio {String}

      16:9

  • QUHD {JSON}

    resolution.

    • width {Integer}

      15360

    • height {Integer}

      8640

    • aspectRatio {String}

      16:9


candidateGenerationState

  Defined in: source/skylink-events.js:110      Available since 0.1.0

Event fired when an ICE gathering state has changed.

Event Payload:

  • state {String}

    The ice candidate generation state. [Rel: Skylink.CANDIDATE_GENERATION_STATE]

  • peerId {String}

    PeerId of the peer that had an ice candidate generation state change.


channelClose

  Defined in: source/skylink-events.js:23      Available since 0.1.0

Event fired when the socket connection to the signaling server has closed.


channelError

  Defined in: source/skylink-events.js:44      Available since 0.1.0

Event fired when the socket connection has occurred an error.

Event Payload:

  • error {Object | String}

    Error message or object thrown.


channelMessage

  Defined in: source/skylink-events.js:33      Available since 0.1.0

Event fired when the socket connection received a message from the signaling server.

Event Payload:

  • message {JSON}

channelOpen

  Defined in: source/skylink-events.js:13      Available since 0.1.0

Event fired when the socket connection to the signaling server is open.


channelRetry

  Defined in: source/skylink-events.js:54      Available since 0.5.6

Event fired when the socket re-tries to connection with fallback ports.

Event Payload:

  • fallbackType {String}

    The type of fallback [Rel: Skylink.SOCKET_FALLBACK]

  • currentAttempt {Integer}

    The current attempt of the fallback re-try attempt.


dataChannelState

  Defined in: source/skylink-events.js:435      Available since 0.1.0

Event fired when a peer's datachannel state has changed.

Event Payload:

  • state {String}

    The datachannel state. [Rel: Skylink.DATA_CHANNEL_STATE]

  • peerId {String}

    PeerId of peer that has a datachannel state change.

  • error {String} Optional

    Error message in case there is failure


dataTransferState

  Defined in: source/skylink-events.js:449      Available since 0.4.1

Event fired when a data transfer state has changed.

  • Note that transferInfo.data sends the blob data, and no longer a blob url.

Event Payload:

  • state {String}

    The data transfer state. [Rel: Skylink.DATA_TRANSFER_STATE]

  • transferId {String}

    TransferId of the data.

  • peerId {String}

    PeerId of the peer that has a data transfer state change.

  • transferInfo {JSON}

    Data transfer information.

    • percentage {JSON}

      The percetange of data being uploaded / downloaded.

    • senderPeerId {JSON}

      PeerId of the sender.

    • data {JSON}

      The blob data. See the createObjectURL method on how you can convert the blob to a download link.

    • name {JSON}

      Data name.

    • size {JSON}

      Data size.

  • error {JSON}

    The error object.

    • message {String}

      Error message thrown.

    • transferType {String}

      Is error from uploading or downloading. [Rel: Skylink.DATA_TRANSFER_TYPE]


handshakeProgress

  Defined in: source/skylink-events.js:97      Available since 0.3.0

Event fired when a peer's handshake progress has changed.

Event Payload:

  • step {String}

    The handshake progress step. [Rel: Skylink.HANDSHAKE_PROGRESS]

  • peerId {String}

    PeerId of the peer's handshake progress.

  • error {Object | String}

    Error message or object thrown.


incomingMessage

  Defined in: source/skylink-events.js:349      Available since 0.5.2

Event fired when a message being broadcasted is received.

  • This is changed from chatMessageReceived, privateMessage and publicMessage event.
  • Note that chatMessageReceived, privateMessage and publicMessage is removed from the specs.

Event Payload:

  • message {JSON}

    Message object that is received.

    • content {JSON | String}

      Data that is broadcasted.

    • senderPeerId {String}

      PeerId of the sender peer.

    • targetPeerId {String}

      PeerId that is specifically targeted to receive the message.

    • isPrivate {Boolean}

      Is data received a private message.

    • isDataChannel {Boolean}

      Is data received from a data channel.

  • peerId {String}

    PeerId of the sender peer.

  • peerInfo {JSON}

    Peer's information.

    • settings {JSON}

      Peer's stream settings.

      • audio {Boolean | JSON} Optional
        Peer's audio stream settings.
      • audio.stereo {Boolean} Optional
        If peer has stereo enabled or not.
      • video {Boolean | JSON} Optional
        Peer's video stream settings.
      • video.resolution {JSON} Optional
        Peer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Integer} Optional
        Peer's video stream resolution width.
      • video.resolution.height {Integer} Optional
        Peer's video stream resolution height.
      • video.frameRate {Integer} Optional
        Peer's video stream resolution minimum frame rate.
    • mediaStatus {JSON}

      Peer stream status.

      • audioMuted {Boolean} Optional
        If peer's audio stream is muted.
      • videoMuted {Boolean} Optional
        If peer's video stream is muted.
    • userData {JSON | String}

      Peer's custom user data.

    • agent {JSON}

      Peer's browser agent.

      • name {String}
        Peer's browser agent name.
      • version {Integer}
        Peer's browser agent version.
  • isSelf {Boolean}

    Is the peer self.


incomingStream

  Defined in: source/skylink-events.js:330      Available since 0.5.5

Event fired when a remote stream has become available.

  • This occurs after the user joins the room.
  • This is changed from addPeerStream event.
  • Note that addPeerStream is removed from the specs.
  • There has been a documentation error whereby the stream it is supposed to be (stream, peerId, isSelf), but instead is received as (peerId, stream, isSelf) in 0.5.0.

Event Payload:

  • peerId {String}

    PeerId of the peer that is sending the stream.

  • stream {Object}

    MediaStream object.

  • isSelf {Boolean}

    Is the peer self.

  • peerInfo {JSON}

    Peer's information.


mediaAccessError

  Defined in: source/skylink-events.js:148      Available since 0.1.0

Event fired when webcam or microphone media access fails.

Event Payload:

  • error {Object | String}

    Error object thrown.


mediaAccessRequired

  Defined in: source/skylink-events.js:168      Available since 0.5.5

Event fired when it's required to have audio or video access.


mediaAccessStopped

  Defined in: source/skylink-events.js:177      Available since 0.5.6

Event fired when media access to MediaStream has stopped.


mediaAccessSuccess

  Defined in: source/skylink-events.js:158      Available since 0.1.0

Event fired when webcam or microphone media acces passes.

Event Payload:

  • stream {Object}

    MediaStream object.


peerConnectionState

  Defined in: source/skylink-events.js:123      Available since 0.1.0

Event fired when a peer Connection state has changed.

Event Payload:

  • state {String}

    The peer connection state. [Rel: Skylink.PEER_CONNECTION_STATE]

  • peerId {String}

    PeerId of the peer that had a peer connection state change.


peerJoined

  Defined in: source/skylink-events.js:186      Available since 0.5.2

Event fired when a peer joins the room.

Event Payload:

  • peerId {String}

    PeerId of the peer that joined the room.

  • peerInfo {JSON}

    Peer's information.

    • settings {JSON}

      Peer's stream settings.

      • audio {Boolean | JSON} Optional
        Peer's audio stream settings.
      • audio.stereo {Boolean} Optional
        If peer has stereo enabled or not.
      • video {Boolean | JSON} Optional
        Peer's video stream settings.
      • video.resolution {JSON} Optional
        Peer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Integer} Optional
        Peer's video stream resolution width.
      • video.resolution.height {Integer} Optional
        Peer's video stream resolution height.
      • video.frameRate {Integer} Optional
        Peer's video stream resolution minimum frame rate.
    • mediaStatus {JSON}

      Peer stream status.

      • audioMuted {Boolean} Optional
        If peer's audio stream is muted.
      • videoMuted {Boolean} Optional
        If peer's video stream is muted.
    • userData {JSON | String}

      Peer's custom user data.

    • agent {JSON}

      Peer's browser agent.

      • name {String}
        Peer's browser agent name.
      • version {Integer}
        Peer's browser agent version.
  • isSelf {Boolean}

    Is the peer self.


peerLeft

  Defined in: source/skylink-events.js:294      Available since 0.5.2

Event fired when a peer leaves the room

Event Payload:

  • peerId {String}

    PeerId of the peer that left.

  • peerInfo {JSON}

    Peer's information.

    • settings {JSON}

      Peer's stream settings.

      • audio {Boolean | JSON} Optional
        Peer's audio stream settings.
      • audio.stereo {Boolean} Optional
        If peer has stereo enabled or not.
      • video {Boolean | JSON} Optional
        Peer's video stream settings.
      • video.resolution {JSON} Optional
        Peer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Integer} Optional
        Peer's video stream resolution width.
      • video.resolution.height {Integer} Optional
        Peer's video stream resolution height.
      • video.frameRate {Integer} Optional
        Peer's video stream resolution minimum frame rate.
    • mediaStatus {JSON}

      Peer stream status.

      • audioMuted {Boolean} Optional
        If peer's audio stream is muted.
      • videoMuted {Boolean} Optional
        If peer's video stream is muted.
    • userData {JSON | String}

      Peer's custom user data.

    • agent {JSON}

      Peer's browser agent.

      • name {String}
        Peer's browser agent name.
      • version {Integer}
        Peer's browser agent version.
  • isSelf {Boolean}

    Is the peer self.


peerRestart

  Defined in: source/skylink-events.js:222      Available since 0.5.5

Event fired when a peer's connection is restarted.

Event Payload:

  • peerId {String}

    PeerId of the peer that is being restarted.

  • peerInfo {JSON}

    Peer's information.

    • settings {JSON}

      Peer's stream settings.

      • audio {Boolean | JSON}
        Peer's audio stream settings.
      • audio.stereo {Boolean}
        If peer has stereo enabled or not.
      • video {Boolean | JSON}
        Peer's video stream settings.
      • video.resolution {JSON}
        Peer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Integer}
        Peer's video stream resolution width.
      • video.resolution.height {Integer}
        Peer's video stream resolution height.
      • video.frameRate {Integer}
        Peer's video stream resolution minimum frame rate.
    • mediaStatus {JSON}

      Peer stream status.

      • audioMuted {Boolean}
        If peer's audio stream is muted.
      • videoMuted {Boolean}
        If peer's video stream is muted.
    • userData {JSON | String}

      Peer's custom user data.

    • agent {JSON}

      Peer's browser agent.

      • name {String}
        Peer's browser agent name.
      • version {Integer}
        Peer's browser agent version.
  • isSelfInitiateRestart {Boolean}

    Is it us who initiated the restart.


peerUpdated

  Defined in: source/skylink-events.js:258      Available since 0.5.2

Event fired when a peer information is updated.

Event Payload:

  • peerId {String}

    PeerId of the peer that had information updaed.

  • peerInfo {JSON}

    Peer's information.

    • settings {JSON}

      Peer's stream settings.

      • audio {Boolean | JSON} Optional
        Peer's audio stream settings.
      • audio.stereo {Boolean} Optional
        If peer has stereo enabled or not.
      • video {Boolean | JSON} Optional
        Peer's video stream settings.
      • video.resolution {JSON} Optional
        Peer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Integer} Optional
        Peer's video stream resolution width.
      • video.resolution.height {Integer} Optional
        Peer's video stream resolution height.
      • video.frameRate {Integer} Optional
        Peer's video stream resolution minimum frame rate.
    • mediaStatus {JSON}

      Peer stream status.

      • audioMuted {Boolean} Optional
        If peer's audio stream is muted.
      • videoMuted {Boolean} Optional
        If peer's video stream is muted.
    • userData {JSON | String}

      Peer's custom user data.

    • agent {JSON}

      Peer's browser agent.

      • name {String}
        Peer's browser agent name.
      • version {Integer}
        Peer's browser agent version.
  • isSelf {Boolean}

    Is the peer self.


readyStateChange

  Defined in: source/skylink-events.js:81      Available since 0.4.0

Event fired whether the room is ready for use.

Event Payload:

  • readyState {String}

    [Rel: Skylink.READY_STATE_CHANGE]

  • error {JSON}

    Error object thrown.

    • status {Integer}

      Http status when retrieving information. May be empty for other errors.

    • content {String}

      Error message.

    • errorCode {Integer}

      Error code. [Rel: Skylink.READY_STATE_CHANGE_ERROR]


roomLock

  Defined in: source/skylink-events.js:397      Available since 0.5.2

Event fired when connected to a room and the lock status has changed.

Event Payload:

  • isLocked {Boolean}

    Is the room locked.

  • peerId {String}

    PeerId of the peer that is locking/unlocking the room.

  • peerInfo {JSON}

    Peer's information.

    • settings {JSON}

      Peer's stream settings.

      • audio {Boolean | JSON} Optional
        Peer's audio stream settings.
      • audio.stereo {Boolean} Optional
        If peer has stereo enabled or not.
      • video {Boolean | JSON} Optional
        Peer's video stream settings.
      • video.resolution {JSON} Optional
        Peer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION]
      • video.resolution.width {Integer} Optional
        Peer's video stream resolution width.
      • video.resolution.height {Integer} Optional
        Peer's video stream resolution height.
      • video.frameRate {Integer} Optional
        Peer's video stream resolution minimum frame rate.
    • mediaStatus {JSON}

      Peer stream status.

      • audioMuted {Boolean} Optional
        If peer's audio stream is muted.
      • videoMuted {Boolean} Optional
        If peer's video stream is muted.
    • userData {JSON | String}

      Peer's custom user data.

    • agent {JSON}

      Peer's browser agent.

      • name {String}
        Peer's browser agent name.
      • version {Integer}
        Peer's browser agent version.
  • isSelf {Boolean}

    Is the peer self.


socketError

  Defined in: source/skylink-events.js:65      Available since 0.5.5

Event fired when the socket connection failed connecting.

  • The difference between this and channelError is that channelError triggers during the connection. This throws when connection failed to be established.

Event Payload:

  • errorCode {String}

    The error code. [Rel: Skylink.SOCKET_ERROR]

  • error {Integer | String | Object}

    The reconnection attempt or error object.

  • fallbackType {String}

    The type of fallback [Rel: Skylink.SOCKET_FALLBACK]


systemAction

  Defined in: source/skylink-events.js:478      Available since 0.5.1

Event fired when the signaling server warns the user.

Event Payload:

  • action {String}

    The action that is required for the user to follow. [Rel: Skylink.SYSTEM_ACTION]

  • message {String}

    The reason for the action.

  • reason {String}

    The reason why the action is given. [Rel: Skylink.SYSTEM_ACTION_REASON]