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.
Methods
Skylink
()
Example:
// Getting started on how to use Skylink var SkylinkDemo = new Skylink(); SkylinkDemo.init('apiKey');
SkylinkDemo.joinRoom('my_room', { userData: 'My Username', audio: true, video: true });
SkylinkDemo.on('incomingStream', function (peerId, stream, peerInfo, isSelf) { if (isSelf) { attachMediaStream(document.getElementById('selfVideo'), stream); } else { var peerVideo = document.createElement('video'); peerVideo.id = peerId; peerVideo.autoplay = 'autoplay'; document.getElementById('peersVideo').appendChild(peerVideo); attachMediaStream(peerVideo, stream); } });
SkylinkDemo.on('peerLeft', function (peerId, peerInfo, isSelf) { if (isSelf) { document.getElementById('selfVideo').src = ''; } else { var peerVideo = document.getElementById(peerId); document.getElementById('peersVideo').removeChild(peerVideo); } });
_ACKProtocolHandler
peerId
,
data
,
channelName
,
)
The user receives an acknowledge of the blob request.
Triggers:
dataTransferStateParameters:
-
peerId
{String}PeerId of the peer that is sending the acknowledgement.
-
data
{JSON}The data object received from datachannel. [Rel: Skylink._DC_PROTOCOL_TYPE.ACK.data]
-
channelName
{String}The datachannel name.
_addIceCandidateFromQueue
targetMid
,
)
Adds all ice candidate from the queue.
Parameters:
-
targetMid
{String}The peerId of the target peer.
_addIceCandidateToQueue
targetMid
,
candidate
,
)
Adds ice candidate to queue.
Parameters:
-
targetMid
{String}The peerId of the target peer.
-
candidate
{Object}The ice candidate object.
_addLocalMediaStreams
peerId
,
)
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]
,
)
We have a peer, this creates a peerconnection object to handle the call. if we are the initiator, we then starts the O/A handshake.
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.
-
-
toOffer
{Boolean} OptionalDEFAULT: falseWhether we should start the O/A or wait.
-
restartConn
{Boolean} OptionalDEFAULT: falseWhether connection is restarted.
-
receiveOnly
{Boolean} OptionalDEFAULT: falseShould they only receive?
_addSDPStereo
sdpLines
,
)
Adds stereo feature to the SDP.
- This requires OPUS to be enabled in the SDP or it will not work.
Parameters:
-
sdpLines
{Array}Sdp received.
Returns:
Updated version with Stereo feature
_answerHandler
message
,
)
Signaling server sends an answer message.
- This occurs when a peer sends an answer message is received.
Triggers:
handshakeProgressParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.ANSWER.message]
_base64ToBlob
dataURL
,
)
Converts base64 string to raw binary data.
- Doesn't handle URLEncoded DataURIs.
- See StackOverflow answer #6850276 for code that does this.
- This is to convert the base64 binary string to a blob.
Parameters:
-
dataURL
{String}Blob base64 dataurl.
_byeHandler
message
,
)
Signaling server sends a bye message.
- This occurs when a peer left the room.
Triggers:
peerLeftParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.BYE.message]
_CANCELProtocolHandler
peerId
,
data
,
channelName
,
)
The user receives a timeout error.
Triggers:
dataTransferStateParameters:
-
peerId
{String}PeerId of the peer that is sending the error.
-
data
{Array}The data object received from datachannel. [Rel: Skylink._DC_PROTOCOL_TYPE.CANCEL.data]
-
channelName
{String}The datachannel name.
_candidateHandler
message
,
)
Signaling server sends a candidate message.
- This occurs when a peer sends an ice candidate.
Parameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.CANDIDATE.message]
_checkDataChannelReadyState
dc
,
callback
,
state
,
)
Triggers callback when datachannel readystate matches the one provided.
Parameters:
-
dc
{Object}The datachannel to check the readystate.
-
callback
{Function}The callback once state has reached.
-
state
{String}The datachannel readystate. [Rel: DATA_CHANNEL_STATE]
_chunkBlobData
blob
,
blobByteSize
,
)
Chunks blob data into chunks.
Parameters:
-
blob
{Blob}The blob data to chunk.
-
blobByteSize
{Integer}The blob data size.
_clearAllStoredLogsFn
[logLevel]
,
)
Gets the list of logs
Parameters:
-
logLevel
{Integer} OptionalThe log level that get() should return. If not provided, it get() will return all logs from all levels. [Rel: Skylink.LOG_LEVEL]
Returns:
The array of logs
_clearDataChannelTimeout
peerId
,
[isSender=false]
,
)
Clears the datachannel timeout.
Parameters:
-
peerId
{String}PeerId of the datachannel to clear timeout.
-
isSender
{Boolean} OptionalDEFAULT: falseIs peer the sender or the receiver.
_closeChannel
()
Closes the socket signaling connection.
_closeDataChannel
peerId
,
)
Closes the datachannel.
Parameters:
-
peerId
{String}PeerId of the peer's datachannel to close.
_condition
eventName
,
callback
,
checkFirst
,
[condition]
,
[fireAlways=false]
,
)
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} OptionalThe 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} OptionalDEFAULT: falseThe function does not get removed onced triggered, but triggers everytime the event is called.
_createDataChannel
peerId
,
[dc]
,
)
Create a DataChannel. Only SCTPDataChannel support.
Triggers:
dataChannelStateParameters:
-
peerId
{String}PeerId of the peer which the datachannel is connected to
-
dc
{Object} OptionalThe datachannel object received.
_createDefaultSocket
()
Create the default socket object connection.
_createFallbackSocket
()
Create the fallback socket object reconnection.
_createLongpollingSocket
()
Create the long-polling fallback socket object reconnection.
_createPeerConnection
targetMid
,
)
Creates a peerconnection 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:
The created peer connection object.
_createSocket
()
Create the socket object to refresh connection.
_dataChannelProtocolHandler
data
,
peerId
,
channelName
,
)
Handles all datachannel protocol events.
Parameters:
-
data
{String | Object}The data received from datachannel.
-
peerId
{String}The peerId of the peer that sent the data.
-
channelName
{String}The datachannel name.
_DATAProtocolHandler
peerId
,
dataString
,
dataType
,
channelName
,
)
This is when the data is sent from the sender to the receiving user.
Triggers:
dataTransferStateParameters:
-
peerId
{String}PeerId of the peer that is sending the data.
-
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.
_doAnswer
targetMid
,
)
We have succesfully received an offer and set it locally. This function will take care of cerating and sendng the corresponding answer. Handshake step 4.
Parameters:
-
targetMid
{String}PeerId of the peer to send answer to.
_doOffer
targetMid
,
peerBrowser
,
)
It then sends it to the peer. Handshake step 3 (offer) or 4 (answer).
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.
-
_enterHandler
message
,
)
Signaling server sends a enter message.
- This occurs when a peer just entered the room.
- If we don't have a connection with the peer, send a welcome.
Triggers:
handshakeProgress, peerJoinedParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.ENTER.message]
_ERRORProtocolHandler
peerId
,
data
,
channelName
,
)
The user receives a timeout error.
Triggers:
dataTransferStateParameters:
-
peerId
{String}PeerId of the peer that is sending the error.
-
data
{Array}The data object received from datachannel. [Rel: Skylink._DC_PROTOCOL_TYPE.ERROR.data]
-
channelName
{String}The datachannel name.
_findSDPLine
sdpLines
,
condition
,
)
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:
[index, line] - Returns the sdpLines based on the condition
_getStoredLogsFn
[logLevel]
,
)
Gets the list of logs
Parameters:
-
logLevel
{Integer} OptionalThe log level that get() should return. If not provided, it get() will return all logs from all levels. [Rel: Skylink.LOG_LEVEL]
Returns:
The array of logs
_initSelectedRoom
[room=Skylink._defaultRoom]
,
callback
,
)
Initialize Skylink to retrieve new connection information based on options.
Triggers:
readyStateChangeParameters:
-
room
{String} OptionalDEFAULT: Skylink._defaultRoomThe room to connect to.
-
callback
{Function}The callback fired once Skylink is re-initialized.
_inRoomHandler
message
,
)
Signaling server sends an inRoom message.
- This occurs the user has joined the room.
Triggers:
peerJoinedParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.IN_ROOM.message]
_loadInfo
()
Start the loading of information from the api server.
Triggers:
readyStateChange_logFn
logLevel
,
message
,
[debugObject]
,
)
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} OptionalThe console parameter string or object.
_MESSAGEProtocolHandler
peerId
,
data
,
channelName
,
)
The user receives a datachannel broadcast message.
Triggers:
incomingMessageParameters:
-
peerId
{String}PeerId of the peer that is sending a broadcast message.
-
data
{JSON}The data object received from datachannel. [Rel: Skylink._DC_PROTOCOL_TYPE.MESSAGE.data]
-
channelName
{String}The datachannel name.
_muteAudioEventHandler
message
,
)
Signaling server sends a muteAudioEvent message.
- This occurs when a peer's audio stream muted status has changed.
Triggers:
peerUpdatedParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.MUTE_AUDIO.message]
_muteLocalMediaStreams
()
Handles the muting of audio and video streams.
Returns:
options.hasVideoTracks If MediaStream(s) has video tracks.
_muteVideoEventHandler
message
,
)
Signaling server sends a muteVideoEvent message.
- This occurs when a peer's video stream muted status has changed.
Triggers:
peerUpdatedParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.MUTE_VIDEO.message]
_offerHandler
message
,
)
Signaling server sends an offer message.
- This occurs when we've just received an offer.
- If there is no existing connection with this peer, create one, then set the remotedescription and answer.
Triggers:
handshakeProgressParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.OFFER.messa]
_onIceCandidate
targetMid
,
event
,
)
A candidate has just been generated (ICE gathering) and will be sent to the peer. Part of connection establishment.
Triggers:
candidateGenerationStateParameters:
-
targetMid
{String}The peerId of the target peer.
-
event
{Event}This is provided directly by the peerconnection API.
_onRemoteStreamAdded
targetMid
,
event
,
)
The remote peer advertised streams, that we are forwarding to the app. This is part of the peerConnection's addRemoteDescription() API's callback.
Triggers:
incomingStreamParameters:
-
targetMid
{String}PeerId of the peer that has remote stream to send.
-
event
{Event}This is provided directly by the peerconnection API.
_onUserMediaError
error
,
)
Access to user's MediaStream failed.
Triggers:
mediaAccessErrorParameters:
-
error
{Object}Error object that was thrown.
_onUserMediaSuccess
stream
,
)
Access to user's MediaStream is successful.
Triggers:
mediaAccessSuccessParameters:
-
stream
{MediaStream}MediaStream object.
_openChannel
()
Initiate a socket signaling connection.
Triggers:
channelMessage, channelOpen, channelError, channelClose_parseAudioStreamSettings
[options=false]
,
)
Parse stream settings
Parameters:
-
options
{Boolean | JSON} OptionalDEFAULT: falseThis call requires video
-
resolution
{JSON} Optional[Rel: Skylink.VIDEO_RESOLUTION]
-
width
{Integer} OptionalVideo width -
height
{Integer} OptionalVideo height
-
-
frameRate
{Integer} OptionalMaximum frameRate of Video
-
Returns:
The parsed video options.
- settings: User set video options
- userMedia: getUserMedia options
_parseAudioStreamSettings
[options=false]
,
)
Parse stream settings
Parameters:
-
options
{Boolean | JSON} OptionalDEFAULT: falseThis call requires audio
-
stereo
{Boolean} OptionalEnabled stereo or not.
-
Returns:
The parsed audio options.
- settings: User set audio options
- userMedia: getUserMedia options
_parseBandwidthSettings
[options]
,
)
Parse and set bandwidth settings.
Parameters:
-
options
{String} OptionalBandwidth settings
-
audio
{String} OptionalDEFAULT: 50Audio Bandwidth
-
video
{String} OptionalDEFAULT: 256Video Bandwidth
-
data
{String} OptionalDEFAULT: 1638400Data Bandwidth
-
_parseDefaultMediaStreamSettings
options
,
)
Parse stream default settings
Parameters:
-
options
{JSON}Media default Constraints.
-
maxWidth
{Boolean | JSON} OptionalDEFAULT: 640Video default width.
-
maxHeight
{Boolean} OptionalDEFAULT: 480Video default height.
-
_parseInfo
info
,
)
Parse the information received from the api server.
Triggers:
readyStateChangeParameters:
-
info
{JSON}The parsed information from the server.
_parseMediaStreamSettings
options
,
)
Parse stream settings
Parameters:
-
options
{JSON}Media Constraints.
-
audio
{Boolean | JSON} OptionalDEFAULT: falseThis call requires audio
-
stereo
{Boolean} OptionalEnabled stereo or not. -
mute
{Boolean} OptionalDEFAULT: false If audio stream should be muted.
-
-
video
{Boolean | JSON} OptionalDEFAULT: falseThis call requires video
-
resolution
{JSON} Optional[Rel: VIDEO_RESOLUTION] -
resolution.width
{Integer} OptionalVideo width -
resolution.height
{Integer} OptionalVideo height -
frameRate
{Integer} OptionalMaximum frameRate of video. -
mute
{Boolean} OptionalDEFAULT: false If video stream should be muted.
-
-
_parseMutedSettings
options
,
)
Parse stream settings
Parameters:
-
options
{JSON}Media Constraints.
-
audio
{Boolean | JSON} OptionalDEFAULT: falseThis call requires audio
-
stereo
{Boolean} OptionalEnabled stereo or not. -
mute
{Boolean} OptionalDEFAULT: false If audio stream should be muted.
-
-
video
{Boolean | JSON} OptionalDEFAULT: falseThis call requires video
-
resolution
{JSON} Optional[Rel: VIDEO_RESOLUTION] -
resolution.width
{Integer} OptionalVideo width -
resolution.height
{Integer} OptionalVideo height -
frameRate
{Integer} OptionalMaximum frameRate of video. -
mute
{Boolean} OptionalDEFAULT: false If video stream should be muted.
-
-
Returns:
The parsed muted options.
_parseUserData
[userData]
,
)
Gets the peer information (media settings,media status and personnal data set by the peer).
Parameters:
-
userData
{JSON} OptionalUser custom data.
_printAllStoredLogsFn
()
Print out all the store logs in console.
_privateMessageHandler
message
,
)
Signaling server sends a privateMessage message.
- This occurs when a peer sends private message to user.
Triggers:
privateMessageParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.PRIVATE_MESSAGE.message]
_processingSingleMessage
message
,
)
Handles the single signaling message received.
Parameters:
-
message
{JSON}The message object received.
_processSigMessage
messageString
,
)
Handles every incoming signaling message received.
- If it's a SIG_TYPE.GROUP message, break them down to single messages and let Skylink/_processSingleMessage:method to handle them.
Parameters:
-
messageString
{String}The message object stringified received.
_publicMessageHandler
message
,
)
Signaling server sends a publicMessage message.
- This occurs when a peer broadcasts a public message to all connected peers.
Triggers:
publicMessageParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.PUBLIC_MESSAGE.message]
_redirectHandler
message
,
)
Signaling server sends a redirect message.
- This occurs when the signaling server is warning us or wanting to move us out when the peer sends too much messages at the same tme.
Triggers:
systemActionParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.REDIRECT.message]
_removePeer
peerId
,
)
Actually clean the peerconnection and trigger an event. Can be called by _byeHandler and leaveRoom.
Triggers:
peerLeftParameters:
-
peerId
{String}PeerId of the peer that has left.
_removeSDPFirefoxH264Pref
sdpLines
,
)
Removes Firefox 32 H264 preference in sdp.
- As noted in bugzilla as bug in here.
Parameters:
-
sdpLines
{Array}Sdp received.
Returns:
Updated version removing Firefox h264 pref support.
_requestServerInfo
method
,
url
,
callback
,
params
,
)
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
,
)
Signaling server sends a restart message.
- SIG_TYPE: RESTART
- This occurs when the other peer initiates the restart process by sending a restart message to signaling server.
Triggers:
handshakeProgress, peerRestartParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.RESTART.message]
_restartPeerConnection
peerId
,
isSelfInitiateRestart
,
)
Restarts a peer connection by sending a RESTART message to signaling server.
Parameters:
-
peerId
{String}PeerId of the peer to restart connection with.
-
isSelfInitiateRestart
{Boolean}If it's self who initiated the restart.
_roomLockEventHandler
message
,
)
Signaling server sends a roomLockEvent message.
- This occurs when a room lock status has changed.
Triggers:
roomLockParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.ROOM_LOCK.message]
_sendBlobDataToPeer
data
,
dataInfo
,
[targetPeerId]
,
isPrivate
,
)
Sends blob data to individual peer.
- This sends the Skylink/WRQ:event and to initiate the TFTP protocol.
Parameters:
-
data
{Blob}The blob data to be sent over.
-
target
{Boolean}Real peerId to send data to, in case MCU is used.
-
-
dataInfo
{JSON}The data information.
-
transferId
{String}transferId of the data.
-
name
{String}Data name.
-
timeout
{Integer} OptionalDEFAULT: 60Data timeout to wait for packets.
-
size
{Integer}Data size
-
-
targetPeerId
{String} OptionalPeerId targeted to receive data. Leave blank to send to all peers.
-
isPrivate
{Boolean}If the file transfer is private
_sendChannelMessage
message
,
)
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
,
)
Sends Message using the datachannel.
Parameters:
-
peerId
{String}PeerId of the peer's datachannel to send data.
-
data
{JSON}The data to send.
_setDataChannelTimeout
peerId
,
timeout
,
[isSender=false]
,
)
Sets the datachannel timeout.
- If timeout is met, it will send the 'ERROR' message
Parameters:
-
peerId
{String}PeerId of the datachannel to set timeout.
-
timeout
{Integer}The timeout to set in seconds.
-
isSender
{Boolean} OptionalDEFAULT: falseIs peer the sender or the receiver?
_setFirefoxIceServers
config
,
)
Sets the STUN server specially for Firefox for ICE Connection.
Parameters:
-
config
{JSON}Ice configuration servers url object.
Returns:
Updated configuration
_setIceServers
config
,
)
Sets the STUN server specially for Firefox for ICE Connection.
Parameters:
-
config
{JSON}Ice configuration servers url object.
Returns:
Updated configuration
_setLocalAndSendMessage
targetMid
,
sessionDescription
,
)
This takes an offer or an aswer generated locally and set it in the peerconnection it then sends it to the peer. Handshake step 3 (offer) or 4 (answer).
Triggers:
handshakeProgressParameters:
-
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
,
)
Set Audio, Video and Data Bitrate in SDP
Parameters:
-
sdpLines
{Array}Sdp received.
Returns:
Updated version with custom Bandwidth settings
_setSDPVideoResolution
sdpLines
,
)
Set Audio, Video and Frame rate in SDP
Parameters:
-
sdpLines
{Array}Sdp received.
Returns:
Updated version with custom Resolution settings
_startPeerConnectionHealthCheck
peerId
,
)
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.
_stopLocalMediaStreams
()
Stops all MediaStreams(s) playback and streaming.
_stopPeerConnectionHealthCheck
peerId
,
)
Stops a peer connection health check.
Parameters:
-
peerId
{String}The peerId of the peer to clear the checking.
_trigger
eventName
,
)
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
,
)
Signaling server sends a updateUserEvent message.
- This occurs when a peer's custom user data is updated.
Triggers:
peerUpdatedParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.UPDATE_USER.message]
_wait
callback
,
condition
,
[intervalTime=50]
,
)
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} OptionalDEFAULT: 50The interval loop timeout.
_waitForLocalMediaStream
callback
,
[options]
,
)
Waits for MediaStream.
- Once the stream is loaded, callback is called
- If there's not a need for stream, callback is called
Triggers:
mediaAccessRequiredParameters:
-
callback
{Function}Callback after requested constraints are loaded.
-
options
{JSON} OptionalMedia Constraints.
-
userData
{JSON} OptionalUser custom data.
-
audio
{Boolean | JSON} OptionalDEFAULT: falseThis call requires audio
-
stereo
{Boolean} OptionalEnabled stereo or not -
mute
{Boolean} OptionalDEFAULT: false If audio stream should be muted.
-
-
video
{Boolean | JSON} OptionalDEFAULT: falseThis call requires video
-
resolution
{JSON} Optional[Rel: VIDEO_RESOLUTION] -
resolution.width
{Integer} OptionalVideo width -
resolution.height
{Integer} OptionalVideo height -
frameRate
{Integer} OptionalMaximum frameRate of Video -
mute
{Boolean} OptionalDEFAULT: false If video stream should be muted.
-
-
bandwidth
{String} OptionalBandwidth settings
-
audio
{String} OptionalAudio Bandwidth -
video
{String} OptionalVideo Bandwidth -
data
{String} OptionalData Bandwidth
-
-
_waitForOpenChannel
[options]
,
)
Wait for room to ready, then wait for socket signaling channel to open.
- If channel is not opened before then open it.
- Once channel is opened, wait for media stream and send a join room request to signaling server.
Triggers:
peerJoined, incomingStream, mediaAccessRequiredParameters:
-
options
{JSON} OptionalMedia Constraints.
-
userData
{JSON | String} OptionalUser custom data.
-
audio
{Boolean | JSON} OptionalDEFAULT: falseThis call requires audio stream.
-
stereo
{Boolean} OptionalOption to enable stereo during call. -
mute
{Boolean} OptionalDEFAULT: false If audio stream should be muted.
-
-
video
{Boolean | JSON} OptionalDEFAULT: falseThis call requires video stream.
-
resolution
{JSON} OptionalThe resolution of video stream. -
resolution.width
{Integer} OptionalThe video stream resolution width. -
resolution.height
{Integer} OptionalThe video stream resolution height. -
frameRate
{Integer} OptionalThe video stream maximum frameRate. -
mute
{Boolean} OptionalDEFAULT: false If video stream should be muted.
-
-
bandwidth
{JSON} OptionalStream bandwidth settings.
-
audio
{Integer} OptionalAudio stream bandwidth in kbps. Recommended: 50 kbps. -
video
{Integer} OptionalVideo stream bandwidth in kbps. Recommended: 256 kbps. -
data
{Integer} OptionalData stream bandwidth in kbps. Recommended: 1638400 kbps.
-
-
_welcomeHandler
message
,
)
Signaling server sends a welcome message.
- This occurs when we've just received a welcome.
- If there is no existing connection with this peer, create one, then set the remotedescription and answer.
Triggers:
handshakeProgress, peerJoinedParameters:
-
message
{JSON}The message object received. [Rel: Skylink._SIG_MESSAGE_TYPE.WELCOME.message]
_WRQProtocolHandler
peerId
,
data
,
channelName
,
)
The user receives a blob request. From here, it's up to the user to accept or reject it
Triggers:
dataTransferStateParameters:
-
peerId
{String}PeerId of the peer that is sending the request.
-
data
{JSON}The data object received from datachannel. [Rel: Skylink._DC_PROTOCOL_TYPE.WRQ.data]
-
channelName
{String}The datachannel name.
cancelBlobTransfer
peerId
,
[transferType]
,
)
Reject file transfer for cancel.
Triggers:
dataTransferState.Parameters:
-
peerId
{String}PeerId of the peer that is expected to receive the request response.
-
transferType
{String} OptionalTransfer type. If not transfer type is provided, It deletes all ongoing request. [Rel: Skylink.DATA_TRANSFER_TYPE]
disableAudio
()
Disable microphone.
- Try to disable the microphone.
- If no microphone was initially set, this function has no effect.
Triggers:
peerUpdated, peerRestartExample:
SkylinkDemo.disableAudio();
disableVideo
()
Disable video source.
- Try to disable the video source.
- If no video source was initially set, this function has no effect.
Triggers:
peerUpdated, peerRestartExample:
SkylinkDemo.disableVideo();
enableAudio
()
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, peerRestartExample:
SkylinkDemo.enableAudio();
enableVideo
()
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, peerRestartExample:
SkylinkDemo.enableVideo();
getPeerInfo
[peerId]
,
)
Gets the peer information.
- If input peerId is user's id or empty, getPeerInfo() would return user's peer information.
Parameters:
-
peerId
{String} OptionalId of the peer retrieve we want to retrieve the information. If no id is set, getPeerInfo() returns self peer information.
Returns:
Peer information:
- settings {JSON}: User stream settings.
- audio {Boolean|JSON}: User audio settings.
- stereo {Boolean} : User has enabled stereo or not.
- video {Boolean|JSON}: User video settings.
- resolution {Boolean|JSON}: User video
resolution set. [Rel: Skylink.VIDEO_RESOLUTION]
- width {Integer}: User video resolution width.
- height {Integer}:User video resolution height.
- resolution {Boolean|JSON}: User video
resolution set. [Rel: Skylink.VIDEO_RESOLUTION]
- frameRate {Integer}: User video minimum frame rate.
- audio {Boolean|JSON}: User audio settings.
- mediaStatus {JSON}: User MediaStream(s) status.
- audioMuted {Boolean}: Is user's audio muted.
- videoMuted {Boolean}: Is user's vide muted.
- userData {String|JSON}: User's custom data set.See setUserData() for more information
If peerId doesn't exist return 'null'.
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
()
Gets the user custom data. See setUserData() for more information
Returns:
User custom data.
Example:
var userInfo = SkylinkDemo.getUserData();
getUserMedia
[options]
,
[callback]
,
)
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, mediaAccessErrorParameters:
-
options
{JSON} OptionalMediaStream constraints.
-
audio
{JSON | Boolean} OptionalDEFAULT: trueOption to allow audio stream.
-
stereo
{Boolean} OptionalOption to enable stereo during call. -
mute
{Boolean} OptionalDEFAULT: false If audio stream should be muted.
-
-
video
{JSON | Boolean} OptionalDEFAULT: trueOption to allow video stream.
-
resolution
{JSON} OptionalThe resolution of video stream. [Rel: Skylink.VIDEO_RESOLUTION] -
resolution.width
{Integer} OptionalThe video stream resolution width (in px). -
resolution.height
{Integer} OptionalThe video stream resolution height (in px). -
frameRate
{Integer} OptionalThe video stream maximum frameRate. -
mute
{Boolean} OptionalDEFAULT: false If video stream should be muted.
-
-
-
callback
{Function} OptionalThe 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]
,
)
Initialize Skylink to retrieve connection information.
- IMPORTANT: Please call this method to load all server information before joining the room or doing anything else.
- If you would like to set the start time and duration of the room,
you have to generate the credentials. In example 3, we use the
CryptoJS library.
- Step 1: Generate the hash. It is created by using the roomname, duration and the timestamp (in ISO String format).
- Step 2: Generate the Credentials. It is is generated by converting the hash to a Base64 string and then encoding it to a URI string.
- Step 3: Initialize Skylink
Triggers:
readyStateChangeParameters:
-
options
{String | JSON}Connection options or API Key ID
-
apiKey
{String}API Key ID to identify with the Temasys backend server
-
defaultRoom
{String} OptionalThe default room to connect to if there is no room provided in joinRoom().
-
roomServer
{String} OptionalPath to the Temasys backend server. If there's no room provided, default room would be used.
-
region
{String} OptionalThe regional server that user chooses to use. [Rel: Skylink.REGIONAL_SERVER]
-
enableIceTrickle
{Boolean} OptionalDEFAULT: trueThe option to enable ICE trickle or not.
-
enableDataChannel
{Boolean} OptionalDEFAULT: trueThe option to enable enableDataChannel or not.
-
enableTURNServer
{Boolean} OptionalDEFAULT: trueTo enable TURN servers in ice connection. Please do so at your own risk as it might disrupt the connection.
-
enableSTUNServer
{Boolean} OptionalDEFAULT: trueTo enable STUN servers in ice connection. Please do so at your own risk as it might disrupt the connection.
-
TURNServerTransport
{Boolean} OptionalDEFAULT: Skylink.TURN_TRANSPORT.ANYTransport to set the transport packet type. [Rel: Skylink.TURN_TRANSPORT]
-
credentials
{JSON} OptionalCredentials 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} OptionalDEFAULT: falseTo allow the option to fallback to audio if failed retrieving video stream.
-
forceSSL
{Boolean} OptionalDEFAULT: falseTo force SSL connections to the API server and signaling server.
-
socketTimeout
{Integer} OptionalDEFAULT: 20000To set the timeout for socket to fail and attempt a reconnection. The mininum value is 5000.
-
-
callback
{Function} OptionalThe 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]
,
)
Once we have initiated Skylink object we can join a room. Calling this function while you are already connected will cause you to leave the current room and connect you to the new room.
- By joining a room you decide to give or not access rights for your video and audio source. It is not possible to give higher rights once you already joined the room.
- You may call getUserMedia() first if you want to get MediaStream and join the room later.
- If joinRoom() parameters are empty, it uses any previous media or user data settings if possible (default values otherwise).
- If no room is specified, user would be joining the default room.
Triggers:
peerJoined, mediaAccessRequiredParameters:
-
room
{String} OptionalDEFAULT: init.options.defaultRoomRoom name to join.
-
options
{JSON} OptionalMedia Constraints
-
userData
{JSON | String} OptionalUser custom data. See setUserData() for more information
-
audio
{Boolean | JSON} OptionalDEFAULT: falseEnable audio stream.
-
stereo
{Boolean} OptionalOption to enable stereo during call. -
mute
{Boolean} OptionalDEFAULT: false If audio stream should be muted.
-
-
video
{Boolean | JSON} OptionalDEFAULT: falseEnable video stream.
-
resolution
{JSON} OptionalThe resolution of video stream. [Rel: Skylink.VIDEO_RESOLUTION] -
resolution.width
{Integer} OptionalThe video stream resolution width (in px). -
resolution.height
{Integer} OptionalThe video stream resolution height (in px). -
frameRate
{Integer} OptionalThe video stream frameRate. -
mute
{Boolean} OptionalDEFAULT: false If audio stream should be muted.
-
-
bandwidth
{JSON} OptionalStream bandwidth settings.
-
audio
{Integer} OptionalDEFAULT: 50 Audio stream bandwidth in kbps. -
video
{Integer} OptionalDEFAULT: 256 Video stream bandwidth in kbps. -
data
{Integer} OptionalDEFAULT: 1638400 Data stream bandwidth in kbps.
-
-
manualGetUserMedia
{Boolean} OptionalGet the user media manually.
-
-
callback
{Function} OptionalThe 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]
,
)
User to leave the room.
Triggers:
peerLeft, channelCloseParameters:
-
callback
{Function} OptionalThe 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
()
Lock the room to prevent other users from joining the room.
Triggers:
lockRoomExample:
SkylinkDemo.lockRoom();
muteStream
options
,
)
Mutes a Local MediaStreams.
Triggers:
peerRestart, peerUpdated, incomingStreamParameters:
-
options
{Object | JSON}The muted options.
-
audioMuted
{Boolean} OptionalDEFAULT: trueIf send a new stream with audio muted.
-
videoMuted
{Boolean} OptionalDEFAULT: trueIf send a new stream with video muted.
-
getEmptyStream
{Boolean} OptionalDEFAULT: falseIf 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
,
)
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
,
)
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]
,
)
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} OptionalThe 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} OptionalDEFAULT: falseThe 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]
,
)
If a connection exist with the specified peer connection it closes it and restart a fresh peer connection.
- Please be noted that a peer connection will be refreshed automatically if user fails to establish a stable connection with peer initially.
Parameters:
-
peerId
{String} OptionalThe Id of the peer whose connection you wish to refresh.
Example:
SkylinkDemo.on('iceConnectionState', function (state, peerId)) { if (iceConnectionState === SkylinkDemo.ICE_CONNECTION_STATE.FAILED) { // Do a refresh SkylinkDemo.refreshConnection(peerId); } });
respondBlobRequest
[peerId]
,
[accept=false]
,
)
User's response to accept or reject data transfer request from another user.
Triggers:
dataTransferStateParameters:
-
peerId
{String} OptionalId of the peer who sent the request.
-
accept
{Boolean} OptionalDEFAULT: falseAccept answer.
sendBlobData
data
,
dataInfo
,
[targetPeerId]
,
[callback]
,
)
Start a public or private data transfer with peer(s).
- Note that peers have the option to accept or reject the receiving data.
- This method is ideal for sending files.
- To send a private file to a peer, input the peer Id after the data information.
- The data transferred is encrypted.
Triggers:
dataTransferStateParameters:
-
data
{Object}The data to be sent over. Data has to be a blob.
-
dataInfo
{JSON}Information required about the data transferred
-
name
{String}Data name (name of the file for example).
-
timeout
{Integer} OptionalDEFAULT: 60The time (in second) before the transfer request is cancelled if not answered.
-
size
{Integer}The data size (in octet)
-
-
targetPeerId
{String} OptionalPeerId targeted to receive data. Leave blank to send to all peers.
-
callback
{Function} OptionalThe callback fired after data was uploaded. Default signature: function(error object, success object)
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]
,
)
Send a message to one or all peer(s) in room.
- WARNING: Map arrays data would be lost when stringified in JSON, so refrain from using map arrays.
- Message is sent using websockets, we don't ensure protection of your message content with this method. Prefer using sendP2PMessage().
Triggers:
incomingMessageParameters:
-
message
{String | JSON}The message data to send.
-
targetPeerId
{String} OptionalPeerId 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]
,
)
Send a message using the DataChannel provided by Webrtc.
- Can choose between broadcasting to the room (public message) and send to a specific peer (private message)
- Content of the message is automatically encrypted during the transfer
- This is ideal for sending strings or json objects lesser than 16KB as noted in here.
- For huge data, please check out function sendBlobData().
- WARNING: Map arrays data would be lost when stringified in JSON, so refrain from using map arrays.
Triggers:
incomingMessageParameters:
-
message
{String | JSON}The message data to send.
-
targetPeerId
{String} OptionalProvide if you want to send to only one peer
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]
,
)
Resends a Local MediaStreams. This overrides all previous MediaStreams sent. Provided MediaStream would be automatically detected as unmuted by default.
Triggers:
peerRestart, incomingStreamParameters:
-
stream
{Object | JSON}The stream object or options.
-
audio
{Boolean} OptionalDEFAULT: falseIf send a new stream with audio.
-
stereo
{Boolean} OptionalOption to enable stereo during call. -
mute
{Boolean} OptionalDEFAULT: false If send a new stream with audio muted.
-
-
video
{JSON | Boolean} OptionalDEFAULT: falseOption to allow video stream.
-
resolution
{JSON} OptionalThe resolution of video stream. [Rel: Skylink.VIDEO_RESOLUTION] -
resolution.width
{Integer} OptionalThe video stream resolution width (in px). -
resolution.height
{Integer} OptionalThe video stream resolution height (in px). -
frameRate
{Integer} OptionalThe video stream maximum frameRate. -
mute
{Boolean} OptionalDEFAULT: false If send a new stream with video muted.
-
-
-
callback
{Function} OptionalThe 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: true, video: false, audioMuted: true });
// 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]
,
)
Sets Skylink in debugging mode to display log stack trace.

Parameters:
-
options
{Boolean | JSON} OptionalDEFAULT: falseIs debugging mode enabled.
-
trace
{Boolean} OptionalDEFAULT: falseIf console output should trace.
-
storeLogs
{Boolean} OptionalDEFAULT: falseIf 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]
,
)
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} OptionalThe 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
,
)
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:
peerUpdatedParameters:
-
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);
unlockRoom
()
Unlock the room to allow other users to join the room.
Triggers:
lockRoomExample:
SkylinkDemo.unlockRoom();
log.debug
()
Outputs a debug log in the console.
Parameters:
-
message
{Array | String}or the message
-
object
{String | Object} OptionalThe log object.
Example:
// Logging for message log.debug('This is my message', object);
log.error
()
Outputs an error log in the console.
Parameters:
-
message
{Array | String}or the message
-
object
{String | Object} OptionalThe log object. // Logging for external information log.error('There has been an error', object);
log.info
()
Outputs an info log in the console.
Parameters:
-
message
{Array | String}or the message
-
object
{String | Object} OptionalThe log object.
Example:
// Logging for message log.debug('This is my message', object);
log.log
()
Outputs a normal log in the console.
Parameters:
-
message
{Array | String}or the message
-
object
{String | Object} OptionalThe log object.
Example:
// Logging for message log.log('This is my message', object);
log.warn
()
Outputs a warning log in the console.
Parameters:
-
message
{Array | String}or the message
-
object
{String | Object} OptionalThe log object.
Example:
// Logging for message log.debug('Here\'s a warning. Please do xxxxx to resolve this issue', object);
SkylinkLogs.clearAllLogs
()
Clear all the stored logs.
SkylinkLogs.getLogs
()
Gets the list of logs
Parameters:
-
logLevel
{Integer} OptionalThe log level that getLogs() should return. If not provided, it getLogs() will return all logs from all levels. [Rel: Skylink.LOG_LEVEL]
Returns:
The array of logs
SkylinkLogs.printAllLogs
()
Print out all the store logs in console.
_audioFallback
Attribute Type: {Boolean}
Fallback to audio call if audio and video is required.
Default value:
false
_DC_PROTOCOL_TYPE
Attribute Type: {JSON}
The list of datachannel protocol types.
- These are the list of available datachannel protocol types expected to be received.
- These protocol types are fixed.
- DATA stage is thrown when JSON failed parsing string, it will then be automatically interpreted as base64 binary string.
- Right now, the datachannel only supports base64 binary string transfer.
- The sub-param data is NOT an actual property of each types.
Keys:
-
WRQ
{String}A data transfer request. Sent when a user requests to transfer a data. Received when a peer has requested to transfer a data. Sent in _sendBlobDataToPeer(). Received in _WRQProtocolHandler().
-
data
{JSON}The data object.
-
agent
{String}The peer's browser agent. -
version
{Integer}The peer's browser version. -
name
{String}The data name. -
size
{Integer}The data size. -
chunkSize
{Integer}The data chunk size expected to receive. -
timeout
{Integer}The timeout to wait for packet response. -
isPrivate
{Boolean}Is the data sent private. -
sender
{String}The sender's peerId. -
type
{String}The type of datachannel protocol.
-
-
-
ACK
{String}Acknowledge to data transfer request and when data packet is received. Sent when a user responses to a data transfer request. Received when a peer has responded to user's data transfer request. Sent in _WRQProtocolHandler(), _DATAProtocolHandler(). Received in _ACKProtocolHandler().
-
data
{JSON}The data object.
-
ackN
{String}The acknowledge request number.0
Request accepted. First packet sent.>0
Transfer is going on.-1
Request rejected.
-
sender
{String}The sender's peerId. -
type
{String}The type of datachannel protocol.
-
-
-
DATA
{String}Data binaryString has been sent or received. Sent when a user responses to a data transfer acknowledgement. Received when a peer sends a data packet. Sent in _ACKProtocolHandler(). Received in _DATAProtocolHandler().
-
data
{String}The base64 binary string data.
-
-
CANCEL
{String}Sent to cancel data transfer. Received when a peer has canceled data transfer. Sending part is not yet implemented. Received in _CANCELProtocolHandler().
-
data
{Array}The data object.
-
name
{String}The data name. -
content
{String}The error message. -
sender
{String}The sender's peerId. -
type
{String}The type of datachannel protocol.
-
-
-
ERROR
{String}Sent when a timeout waiting for peer response has exceeded limit. Received from peer that timeout has reached its limit. Data transfer has failed. Sent in _setDataChannelTimeout(). Received in _ERRORProtocolHandler().
-
data
{Array}The data object.
-
name
{String}The data name. -
content
{String}The error message. -
isUploadError
{Boolean} OptionalIs the error occurring at upload state. -
sender
{String}The sender's peerId. -
type
{String}The type of datachannel protocol.
-
-
-
MESSAGE
{String}Sent a user sends a P2P message. Received when a peer sends a P2P message. Sent in sendP2PMessage(). Received in _MESSAGEProtocolHandler().
-
data
{JSON}The data object.
-
target
{String}The target peerId to receive the data. -
data
{String | JSON}The data to be received. -
sender
{String}The sender's peerId. -
type
{String}The type of datachannel protocol.
-
-
_defaultRoom
Attribute Type: {String}
The default room that the user connects to if no room is provided in joinRoom().
_defaultStreamSettings
Attribute Type: {JSON}
The user stream settings.
Keys:
-
audio
{Boolean | JSON} OptionalIf user enables audio, this is the default setting.
-
stereo
{Boolean} OptionalEnabled stereo or not
-
-
video
{Boolean | JSON} OptionalIf user enables video, this is the default setting.
-
resolution
{JSON} Optional[Rel: Skylink.VIDEO_RESOLUTION]
-
width
{Integer} OptionalVideo width -
height
{Integer} OptionalVideo height
-
-
frameRate
{Integer} OptionalMaximum frameRate of Video
-
-
bandwidth
{String}Bandwidth settings.
-
audio
{String}Audio default Bandwidth
-
video
{String}Video default Bandwidth
-
data
{String}Data default Bandwidth.
-
_enableDataChannel
Attribute Type: {Boolean}
The current state if datachannel is enabled.
Default value:
true
_enableDebugMode
Attribute Type: {Boolean}
The current state if debugging mode is enabled.
Default value:
false
_enableDebugStack
Attribute Type: {Boolean}
The current state if debugging mode should store the logs in SkylinkLogs.
Default value:
false
_enableDebugTrace
Attribute Type: {Boolean}
The current state if debugging mode should print the trace in every log information.
Default value:
false
_enableIceTrickle
Attribute Type: {Boolean}
The current state if ICE trickle is enabled.
Default value:
true
_enableSTUN
Attribute Type: {Boolean}
The current state if STUN servers are enabled.
Default value:
true
_enableTURN
Attribute Type: {Boolean}
The current state if TURN servers are enabled.
Default value:
true
_forceSSL
Attribute Type: {Boolean}
Force an SSL connection to signalling and API server.
Default value:
false
_getUserMediaSettings
Attribute Type: {JSON}
The getUserMedia settings parsed from _streamSettings.
Keys:
-
audio
{Boolean | JSON} OptionalThis call requires audio.
-
video
{Boolean | JSON} OptionalThis call requires video.
-
mandatory.maxHeight
{Integer} OptionalVideo maximum width.
-
mandatory.maxWidth
{Integer} OptionalVideo maximum height.
-
mandatory.maxFrameRate
{Integer} OptionalMaximum frameRate of Video.
-
optional
{Array} OptionalThe getUserMedia options.
-
_mediaStreamsStatus
Attribute Type: {JSON}
The user MediaStream(s) status.
Keys:
-
audioMuted
{Boolean} OptionalIs user's audio muted.
-
videoMuted
{Boolean} OptionalIs user's vide muted.
_MOZ_CHUNK_FILE_SIZE
Attribute Type: {Integer}
The fixed for each data chunk for firefox implementation.
- Firefox the sender chunks
49152
but receives as16384
.
_onceEvents
Attribute Type: {JSON}
Events with callbacks that would be fired only once once condition is met.
_path
Attribute Type: {String}
The path that user is currently connect to.
- NOTE ALEX: check if last char is '/'
Default value:
Skylink._serverPath
_peerConnectionHealthTimers
Attribute Type: {Object}
Internal array of peer connection timeouts.
- The default 1 minute for health timeout.
_readyState
Attribute Type: {Integer}
The current Skylink ready state change. [Rel: Skylink.READY_STATE_CHANGE]
_room
Attribute Type: {JSON}
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}
The credentials required to set the start date and time and the duration.
_roomServer
Attribute Type: {String}
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}
The static room's meeting starting date and time.
- The value is in ISO formatted string.
_selectedRoom
Attribute Type: {String}
The room that the user is currently connected to.
Default value:
Skylink._defaultRoom
_SIG_MESSAGE_TYPE
Attribute Type: {JSON}
The list of signaling message types.
- These are the list of available signaling message types expected to be sent and received.
- These message types are fixed.
- The sub-param message is NOT an actual property of each types.
Keys:
-
JOIN_ROOM
{String}User request to join the room. Sent in _waitForOpenChannel().
-
message
{JSON}The message object.
-
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}The type of message.
-
-
-
IN_ROOM
{String}Response from server that user has joined the room. Received in _inRoomHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
sid
{String}PeerId of self. -
mid
{String}PeerId of the peer that is sending the joinRoom message. -
pc_config
{JSON}The peerconnection configuration. -
type
{String}The type of message.
-
-
-
ENTER
{String}Step 1 of the handshake. Sent as a broadcast message to inform other connected peers in the room that the user is the new peer joining the room. Received when a peer has just joined the room. Sent in _inRoomHandler(). Received in _enterHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
mid
{String}PeerId of the peer that is sending the enter shake. -
receiveOnly
{Boolean} OptionalPeer to receive only. -
agent
{String}Peer's browser agent. -
version
{String}Peer's browser version. -
userInfo
{String}Peer's user information. -
userInfo.settings
{JSON}Peer's stream settings -
userInfo.settings.audio
{Boolean | JSON} Optional -
userInfo.settings.audio.stereo
{Boolean} Optional -
userInfo.settings.video
{Boolean | JSON} Optional -
userInfo.settings.video.resolution
{JSON} Optional[Rel: Skylink.VIDEO_RESOLUTION] -
userInfo.settings.video.resolution.width
{Integer} Optional -
userInfo.settings.video.resolution.height
{Integer} Optional -
userInfo.settings.video.frameRate
{Integer} Optional -
userInfo.mediaStatus
{JSON}Peer stream status. -
userInfo.mediaStatus.audioMuted
{Boolean} OptionalIf peer's audio stream is muted. -
userInfo.mediaStatus.videoMuted
{Boolean} OptionalIf peer's video stream is muted. -
userInfo.userData
{String | JSON}Peer custom data. -
type
{String}The type of message.
-
-
-
WELCOME
{String}Reponse to start createOffer(). Sent as a respond to user to request peer to create the offer. Received as a response from peer that peer acknowledges the user has joined the room and create the offer. Sent in _enterHandler(), _doOffer(), _restartPeerConnection. Received in _welcomeHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
mid
{String}PeerId of the peer that is sending the welcome shake. -
receiveOnly
{Boolean} OptionalPeer to receive only -
enableIceTrickle
{Boolean} OptionalOption to enable Ice trickle or not -
enableDataChannel
{Boolean} OptionalOption to enable DataChannel or not -
userInfo
{String}Peer's user information. -
userInfo.settings
{JSON}Peer's stream settings -
userInfo.settings.audio
{Boolean | JSON} Optional -
userInfo.settings.audio.stereo
{Boolean} Optional -
userInfo.settings.video
{Boolean | JSON} Optional -
userInfo.settings.video.resolution
{JSON} Optional[Rel: Skylink.VIDEO_RESOLUTION] -
userInfo.settings.video.resolution.width
{Integer} Optional -
userInfo.settings.video.resolution.height
{Integer} Optional -
userInfo.settings.video.frameRate
{Integer} Optional -
userInfo.mediaStatus
{JSON}Peer stream status. -
userInfo.mediaStatus.audioMuted
{Boolean} OptionalIf peer's audio stream is muted. -
userInfo.mediaStatus.videoMuted
{Boolean} OptionalIf peer's video stream is muted. -
userInfo.userData
{String | JSON}Peer custom data. -
agent
{String}Browser agent. -
version
{String}Browser version. -
target
{String}PeerId of the peer targeted to receieve this message. -
weight
{Integer}The weight of the message.>=0
Weight priority message.-1
Restart handshake but not refreshing peer connection object.-2
Restart handshake and refresh peer connection object. This invokes a peerRestart event.
-
type
{String}The type of message.
-
-
-
OFFER
{String}An offer has been created. Sent as a response to peer's request to create an offer. Received as a response from peer's offer message. Sent in _setLocalAndSendMessage(), _onIceCandidate() Received in _offerHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
mid
{String}PeerId of the peer that is sending the offer shake. -
sdp
{String}Offer sessionDescription -
type
{String}The type of message.
-
-
-
ANSWER
{String}An answer has been created as an response to the offer. Sent as a response to peer's offer message. Received as a response from peer's answer message. This is when connection is established. Sent in _setLocalAndSendMessage(). Received in _answerHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
sdp
{String}Answer sessionDescription -
mid
{String}PeerId of the peer that is sending the enter shake. -
type
{String}The type of message.
-
-
-
CANDIDATE
{String}A peer's ICE candidate is created and received. Sent when onicecandidate is called. Received when peer sends an ice candidate. Sent in _onIceCandidate(). Received in _candidateHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
mid
{String}PeerId of the peer that is sending the offer shake. -
sdp
{String}Offer sessionDescription. -
target
{String}PeerId that is specifically targeted to receive the message. -
id
{String}Peer's ICE candidate id. -
candidate
{String}Peer's ICE candidate object. -
label
{String}Peer's ICE candidate label. -
type
{String}The type of message.
-
-
-
BYE
{String}A peer has left the room. Received when a peer has left the room. Received in _byeHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
mid
{String}PeerId of the peer that has left the room. -
type
{String}The type of message received.
-
-
-
REDIRECT
{String}Server redirecting user or warning user. Received as a server warning or redirect to user. Received in _redirectHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
info
{String}The reason for this action. -
action
{String}The action to work on. [Rel: Skylink.SYSTEM_ACTION] -
reason
{String}The reason of why the action is worked upon. [Rel: Skylink.SYSTEM_ACTION_REASON] -
type
{String}The type of message.
-
-
-
UPDATE_USER
{String}A peer's userData is updated. Sent when the user's userData is updated. Received when peer's userData is updated. Sent in setUserData(). Received in _updateUserEventHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
mid
{String}PeerId of the peer that is sending the updated event. -
userData
{JSON | String}The peer's user data. -
type
{String}The type of message.
-
-
-
ROOM_LOCK
{String}The room lock status has changed. Sent when the room lock status has been updated by user. Received when room lock status has changed by user. Sent in lockRoom(), unlockRoom(). Received in _roomLockEventHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
mid
{String}PeerId of the peer that is sending the updated room lock status. -
lock
{String}If room is locked or not. -
type
{String}The type of message.
-
-
-
MUTE_VIDEO
{String}A user's audio mute status has changed. Sent when user has muted video status changed. Received when a peer's muted video status has changed. Sent in Skylink/_handleLocalMediaStreams:method. Received in _muteVideoEventHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
mid
{String}PeerId of the peer that is sending their own updated video streams status. -
muted
{String}If video stream is muted or not. -
type
{String}The type of message.
-
-
-
MUTE_AUDIO
{String}A user's video mute status has changed. Sent when user has muted audio status changed. Received when a peer's muted audio status has changed. Sent in Skylink/_handleLocalMediaStreams:method. Received in _muteAudioEventHandler().
-
message
{JSON}The message object.
-
rid
{String}RoomId of the connected room. -
mid
{String}PeerId of the peer that is sending their own updated audio stream status. -
muted
{String}If audio stream is muted or not. -
type
{String}The type of message.
 Received when user receives a peer's broadcast message. Sent in sendMessage(). Received in _publicMessageHandler().
-
message
{JSON}The message object.
-
data
{JSON | String}The data broadcasted -
rid
{String}RoomId of the connected room. -
cid
{String}CredentialId of the room. -
mid
{String}PeerId of the peer that is sending a private broadcast message. -
type
{String}The type of message.
-
-
-
PRIVATE_MESSAGE
{String}Sent when a user sends a private message to a peers. Received when user receives a peer's private message targeted to user. Sent in sendMessage(). Received in _privateMessageHandler().
-
message
{JSON}The message object.
-
data
{JSON | String}The data received. -
rid
{String}RoomId of the connected room. -
cid
{String}CredentialId of the room. -
mid
{String}PeerId of the peer that is sending a private broadcast message. -
type
{String}The type of message.
-
-
-
RESTART
{String}Sent when a user requires to restart a peer connection. Received when user receives a peer connection is restarted. Sent in {{#crossLink "Skylink/_restartPeerConnection:method"}} _restartPeerConnection(){{/crossLink}}. Received in {{#crossLink "Skylink/_restartHandler:method"}}.
-
message.rid
{String}RoomId of the connected room.
-
message.mid
{String}PeerId of the peer that is sending the welcome shake.
-
message.receiveOnly
{Boolean} OptionalPeer to receive only
-
message.enableIceTrickle
{Boolean} OptionalOption to enable Ice trickle or not
-
message.enableDataChannel
{Boolean} OptionalOption to enable DataChannel or not
-
message.userInfo
{String}Peer's user information.
-
message.userInfo.settings
{JSON}Peer's stream settings
-
message.userInfo.settings.audio
{Boolean | JSON} Optional -
message.userInfo.settings.audio.stereo
{Boolean} Optional -
message.userInfo.settings.video
{Boolean | JSON} Optional -
message.userInfo.settings.video.resolution
{JSON} Optional[Rel: Skylink.VIDEO_RESOLUTION]
-
message.userInfo.settings.video.resolution.width
{Integer} Optional -
message.userInfo.settings.video.resolution.height
{Integer} Optional -
message.userInfo.settings.video.frameRate
{Integer} Optional -
message.userInfo.mediaStatus
{JSON}Peer stream status.
-
message.userInfo.mediaStatus.audioMuted
{Boolean} OptionalIf peer's audio stream is muted.
-
message.userInfo.mediaStatus.videoMuted
{Boolean} OptionalIf peer's video stream is muted.
-
message.userInfo.userData
{String | JSON}Peer custom data.
-
message.agent
{String}Browser agent.
-
message.version
{String}Browser version.
-
message.target
{String}PeerId of the peer targeted to receieve this message.
-
_signalingServerPort
Attribute Type: {Integer}
The signaling server port to connect to.
Default value:
https: = 443, http = 80
_signalingServerProtocol
Attribute Type: {String}
The signaling server protocol to use.
https:
- Default port is
443
. - Fallback port is
3443
.
- Default port is
http:
- Default port is
80
. - Fallback port is
3000
.
- Default port is
_socketTimeout
Attribute Type: {Integer}
The socket connection timeout
0
Uses the default timeout from socket.io20000
ms.>0
Uses the user set timeout
Default value:
0
_socketUseXDR
Attribute Type: {Boolean}
The socket connection to use XDomainRequest.
Default value:
false
_streamSettings
Attribute Type: {JSON}
The user stream settings.
Keys:
-
audio
{Boolean | JSON} OptionalThis call requires audio
-
stereo
{Boolean} OptionalEnabled stereo or not
-
-
video
{Boolean | JSON} OptionalThis call requires video
-
resolution
{JSON} Optional[Rel: Skylink.VIDEO_RESOLUTION]
-
width
{Integer} OptionalVideo width -
height
{Integer} OptionalVideo height
-
-
frameRate
{Integer} OptionalMaximum frameRate of Video
-
-
bandwidth
{String} OptionalBandwidth settings
-
audio
{String} OptionalAudio Bandwidth
-
video
{String} OptionalVideo Bandwidth
-
data
{String} OptionalData Bandwidth.
-
_STUNSSL
Attribute Type: {Boolean}
source/ice-connection.js:97
Available since 0.5.4
SSL option for STUN servers.
Default value:
false
_TURNSSL
Attribute Type: {Boolean}
source/ice-connection.js:111
Available since 0.5.4
SSL option for TURN servers.
Default value:
false
_TURNTransport
Attribute Type: {String}
The transport protocol for TURN servers.
Default value:
Skylink.TURN_TRANSPORT.ANY
_user
Attribute Type: {JSON}
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.
CANDIDATE_GENERATION_STATE
Attribute Type: {JSON}
The list of ICE candidate generation states.
- Check out the w3 specification documentation.
- This is RTCIceGatheringState of the peer.
- The states that would occur are:
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 this RTCPeerConnection.
-
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}
The list of datachannel states.
- Based on w3 specification documentation with an additional ERROR state to facilitate the onerror event handler of RTCDataChannel.
- This is the RTCDataChannelState of the peer.
- The states that would occur are:
Keys:
-
CONNECTING
{String}The user agent is attempting to establish the underlying data transport. This is the initial state of a RTCDataChannel object created with createDataChannel().
-
OPEN
{String}The underlying data transport is established and communication is possible. This is the initial state of a RTCDataChannel object dispatched as a part of a RTCDataChannelEvent.
-
CLOSING
{String}The procedure to close down the underlying data transport has started.
-
CLOSED
{String}The underlying data transport has been closed or could not be established.
-
ERROR
{String}Datachannel is not available due to an exception.
DATA_TRANSFER_DATA_TYPE
Attribute Type: {JSON}
The list of data transfer data types.
- TODO: ArrayBuffer and Blob data transfer in datachannel.
- The available data transfer data types are:
Keys:
-
BINARY_STRING
{String}BinaryString data type.
-
ARRAY_BUFFER
{String} OptionalStill-implementing. ArrayBuffer data type.
-
BLOB
{String} OptionalStill-implementing. Blob data type.
DATA_TRANSFER_STATE
Attribute Type: {JSON}
The list of datachannel transfer state.
- These are the states to inform the state of the data transfer.
- The list of states would occur are:
Keys:
-
UPLOAD_REQUEST
{String}Peer has a data transfer request.
-
UPLOAD_STARTED
{String}Data transfer of upload has just started.
-
DOWNLOAD_STARTED
{String}Data transfer of download has just started.
-
UPLOADING
{String}Data upload transfer is occurring.
-
DOWNLOADING
{String}Data download transfer is occurring.
-
UPLOAD_COMPLETED
{String}Data upload transfer has been completed.
-
DOWNLOAD_COMPLETED
{String}Data download transfer has been completed.
-
REJECTED
{String}Peer rejected user's data transfer request.
-
ERROR
{String}Data transfer had an error occurred when uploading or downloading file.
DATA_TRANSFER_TYPE
Attribute Type: {JSON}
The list of datachannel transfer types.
- This is used to identify if the stream is an upload stream or a download stream.
- The available types are:
Keys:
-
UPLOAD
{String}The datachannel transfer is an upload stream.
-
DOWNLOAD
{String}The datachannel transfer is a download stream.
HANDSHAKE_PROGRESS
Attribute Type: {JSON}
The list of handshake progress steps.
- This are the list of steps for the Skylink peer connection.
- The steps that would occur are:
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}
The list of ICE connection states.
- Check out the w3 specification documentation.
- This is the RTCIceConnection state of the peer.
- The states that would occur are:
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}
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}
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}
The list of peer connection states.
- Check out the w3 specification documentation.
- This is the RTCSignalingState of the peer.
- The states that would occur are:
Keys:
-
STABLE
{String}There is no offer/answer exchange in progress. This is also the initial state in which case the local and remote descriptions are empty.
-
HAVE_LOCAL_OFFER
{String}A local description, of type "offer", has been successfully applied.
-
HAVE_REMOTE_OFFER
{String}A remote description, of type "offer", has been successfully applied.
-
HAVE_LOCAL_PRANSWER
{String}A remote description of type "offer" has been successfully applied and a local description of type "pranswer" has been successfully applied.
-
HAVE_REMOTE_PRANSWER
{String}A local description of type "offer" has been successfully applied and a remote description of type "pranswer" has been successfully applied.
-
CLOSED
{String}The connection is closed.
READY_STATE_CHANGE
Attribute Type: {JSON}
The list of api server data retrieval state.
- These are the states to inform the state of retrieving the information from the api server required to start the peer connection or if the browser is eligible to start the peer connection.
- This is the first event that would fired, because Skylink would retrieve information from the api server that is required to start the connection.
- Once the state is COMPLETED, Skylink is ready to start the call.
- The states that would occur are:
Keys:
-
INIT
{Integer}Skylink has just started. No information are retrieved yet.
-
LOADING
{Integer}Skylink is starting the retrieval of the connection information.
-
COMPLETED
{Integer}Skylink has completed retrieving the connection.
-
ERROR
{Integer}Skylink has occurred an error when retrieving the connection information.
READY_STATE_CHANGE_ERROR
Attribute Type: {JSON}
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}
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.
SOCKET_ERROR
Attribute Type: {JSON}
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}
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}
The list of signaling actions received.
- These are usually received from the signaling server to warn the user.
- The system action outcomes are:
Keys:
-
WARNING
{String}Server is warning user to take actions.
-
REJECT
{String}Server has rejected user from room.
SYSTEM_ACTION_REASON
Attribute Type: {JSON}
The list of signaling actions received.
- These are usually received from the signaling server to warn the user.
- The system action outcomes are:
Keys:
-
FAST_MESSAGE
{String}User sends quick messages less than a second resulting in a warning. Continuous quick messages results in user being kicked out of the room.
-
ROOM_LOCKED
{String}Room is locked and user is locked from joining the room.
-
ROOM_FULL
{String}Persistent meeting. Room is full.
-
DUPLICATED_LOGIN
{String}User has same id
-
SERVER_ERROR
{String}Server has an error
-
VERIFICATION
{String}Verification for roomID
-
EXPIRED
{String}Persistent meeting. Room has expired and user is unable to join the room.
-
ROOM_CLOSED
{String}Persistent meeting. Room has expired and is closed, user to leave the room.
-
ROOM_CLOSING
{String}Persistent meeting. Room is closing soon.
-
OVER_SEAT_LIMIT
{String}Seat limit is hit. API Key do not have sufficient seats to continue.
TURN_TRANSPORT
Attribute Type: {JSON}
The list of available TURN server protocols.
- The available protocols are:
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
VIDEO_RESOLUTION
Attribute Type: {JSON}
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
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
Event fired when the socket connection to the signaling server has closed.
channelError
Event fired when the socket connection has occurred an error.
Event Payload:
-
error
{Object | String}Error message or object thrown.
channelMessage
Event fired when the socket connection received a message from the signaling server.
Event Payload:
-
message
{JSON}
channelOpen
Event fired when the socket connection to the signaling server is open.
channelRetry
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
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.
dataTransferState
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
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
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} OptionalPeer's audio stream settings. -
audio.stereo
{Boolean} OptionalIf peer has stereo enabled or not. -
video
{Boolean | JSON} OptionalPeer's video stream settings. -
video.resolution
{JSON} OptionalPeer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Integer} OptionalPeer's video stream resolution width. -
video.resolution.height
{Integer} OptionalPeer's video stream resolution height. -
video.frameRate
{Integer} OptionalPeer's video stream resolution minimum frame rate.
-
-
mediaStatus
{JSON}Peer stream status.
-
audioMuted
{Boolean} OptionalIf peer's audio stream is muted. -
videoMuted
{Boolean} OptionalIf 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
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
Event fired when webcam or microphone media access fails.
Event Payload:
-
error
{Object | String}Error object thrown.
mediaAccessRequired
Event fired when it's required to have audio or video access.
mediaAccessStopped
Event fired when media access to MediaStream has stopped.
mediaAccessSuccess
Event fired when webcam or microphone media acces passes.
Event Payload:
-
stream
{Object}MediaStream object.
peerConnectionHealth
Event fired when a peer connection health has changed.
Event Payload:
-
health
{String}The peer connection health. [Rel: Skylink.PEER_CONNECTION_HEALTH]
-
peerId
{String}PeerId of the peer that had a peer connection health change.
peerConnectionState
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
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} OptionalPeer's audio stream settings. -
audio.stereo
{Boolean} OptionalIf peer has stereo enabled or not. -
video
{Boolean | JSON} OptionalPeer's video stream settings. -
video.resolution
{JSON} OptionalPeer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Integer} OptionalPeer's video stream resolution width. -
video.resolution.height
{Integer} OptionalPeer's video stream resolution height. -
video.frameRate
{Integer} OptionalPeer's video stream resolution minimum frame rate.
-
-
mediaStatus
{JSON}Peer stream status.
-
audioMuted
{Boolean} OptionalIf peer's audio stream is muted. -
videoMuted
{Boolean} OptionalIf 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
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} OptionalPeer's audio stream settings. -
audio.stereo
{Boolean} OptionalIf peer has stereo enabled or not. -
video
{Boolean | JSON} OptionalPeer's video stream settings. -
video.resolution
{JSON} OptionalPeer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Integer} OptionalPeer's video stream resolution width. -
video.resolution.height
{Integer} OptionalPeer's video stream resolution height. -
video.frameRate
{Integer} OptionalPeer's video stream resolution minimum frame rate.
-
-
mediaStatus
{JSON}Peer stream status.
-
audioMuted
{Boolean} OptionalIf peer's audio stream is muted. -
videoMuted
{Boolean} OptionalIf 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
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
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} OptionalPeer's audio stream settings. -
audio.stereo
{Boolean} OptionalIf peer has stereo enabled or not. -
video
{Boolean | JSON} OptionalPeer's video stream settings. -
video.resolution
{JSON} OptionalPeer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Integer} OptionalPeer's video stream resolution width. -
video.resolution.height
{Integer} OptionalPeer's video stream resolution height. -
video.frameRate
{Integer} OptionalPeer's video stream resolution minimum frame rate.
-
-
mediaStatus
{JSON}Peer stream status.
-
audioMuted
{Boolean} OptionalIf peer's audio stream is muted. -
videoMuted
{Boolean} OptionalIf 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.
presenceChanged
Event fired when a peer joins the room
Event Payload:
-
users
{JSON}The list of users
readyStateChange
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
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} OptionalPeer's audio stream settings. -
audio.stereo
{Boolean} OptionalIf peer has stereo enabled or not. -
video
{Boolean | JSON} OptionalPeer's video stream settings. -
video.resolution
{JSON} OptionalPeer's video stream resolution [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Integer} OptionalPeer's video stream resolution width. -
video.resolution.height
{Integer} OptionalPeer's video stream resolution height. -
video.frameRate
{Integer} OptionalPeer's video stream resolution minimum frame rate.
-
-
mediaStatus
{JSON}Peer stream status.
-
audioMuted
{Boolean} OptionalIf peer's audio stream is muted. -
videoMuted
{Boolean} OptionalIf 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
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
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]


LOGO
Log Out
Audience Overview
Roseville,CA
SETTINGS
PROJECTS
CALENDAR
SETTINGS
SETTINGS
1
2
3
4
<
>
Support Requests
View All
TIME
USER NAME
STATUS
9:45pm
<EMAIL_ADDRESS>Solved
9:45pm
<EMAIL_ADDRESS>Solved
LOGO
NEWS
CHANNELS
OVERVIEW
TIMELINE
SPORT
CULTURE
NATURE
MUSIC
WEATHER
AUTOS
LOCAL
SHOP
FUTURE
FOOD
EARTH
TV
TRAVEL
RADIO


Tools
Currency Converter
Convert the price of any item in your local currency by converting the price of that item to the currency of your choice!
Currency ConverterEmergency Contacts
It's important to have the contacts of important agencies at hand. You never know when you might need their assistance!
Emergency ContactsTranslator
Having trouble understanding our multiple languages? Use our translator for easier communication amongst multiple languages!
TranslatorWeather Forecast
Singapore's weather can be rather erratic at times. Stay on top of the weather by constantly checking in with our weather function!
Weather ForecastCovid Stats
Stay safe from Covid 19, check our real-time Covid Numbers before planning your next activity to a crowded area.
Covid Stats