{Object | String}The error that occurred when having a DataChannel connection data transfer with associated Peer. -
transferInfo
{JSON}The transfer data object information. -
transferInfo.name
{String} OptionalDEFAULT: transferId The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID. -
transferInfo.size
{Number}The transfer data size. -
transferInfo.transferId
{String}The data transfer ID. -
transferInfo.dataType
{String}The type of data transfer initiated. Available types are"dataURL"
and"blob"
. -
transferInfo.timeout
{String}The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer. -
transferInfo.isPrivate
{Boolean}The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
-
-
success
{JSON}The success object received in the callback. If received as
null
, it means that there are errors.-
state
{String} OptionalDEFAULT: null Deprecated. The dataTransferState when the data transfer has been completed successfully. This only triggers for a single targeted Peer data transfer. -
transferId
{String}The transfer ID of the successful data transfer. -
peerId
{String} OptionalDEFAULT: null The single targeted Peer ID for the data transfer. This only triggers for single targeted Peer data transfer. -
listOfPeers
{Array}The list of Peer that the data transfer has been initiated with. -
isPrivate
{Boolean}The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers. -
transferInfo
{JSON}The transfer data object information. -
transferInfo.name
{String} OptionalDEFAULT: transferId The transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID. -
transferInfo.size
{Number}The transfer data size. -
transferInfo.transferId
{String}The data transfer ID. -
transferInfo.dataType
{String}The type of data transfer initiated. Available types are"dataURL"
and"blob"
. -
transferInfo.timeout
{String}The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer. -
transferInfo.isPrivate
{Boolean}The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
-
-
Example:
// Example 1: Send file to all peers connected SkylinkDemo.sendBlobData(file, 67);
// Example 2: Send file to individual peer SkylinkDemo.sendBlobData(blob, 87, targetPeerId);
// Example 3: Send file with callback SkylinkDemo.sendBlobData(data,{ name: data.name, size: data.size },function(error, success){ if (error){ console.error("Error happened. Could not send file", error); } else{ console.info("Successfully uploaded file"); } });
sendMessage
message
,
[targetPeerId]
,
)
Send a message object or string using the platform signaling socket connection to the list of targeted PeerConnections. To send message objects with DataChannel connections, see sendP2PMessage().
Triggers:
incomingMessageParameters:
-
message
{String | JSON}The message object.
-
targetPeerId
{String | Array} OptionalThe array of targeted PeerConnections to transfer the message object to. Alternatively, you may provide this parameter as a string to a specific targeted Peer to transfer the message object.
Example:
// Example 1: Send to all peers SkylinkDemo.sendMessage("Hi there!"");
// Example 2: Send to a targeted peer SkylinkDemo.sendMessage("Hi there peer!", targetPeerId);
sendP2PMessage
message
,
[targetPeerId]
,
)
Send a message object or string using the DataChannel connection associated with the list of targeted Peers.
- The maximum size for the message object would be
16Kb
. - To send a string length longer than
16kb
, please considered to use sendURLData() to send longer strings (for that instance base64 binary strings are long). - To send message objects with platform signaling socket connection, see sendMessage().
Triggers:
incomingMessageParameters:
-
message
{String | JSON}The message object.
-
targetPeerId
{String | Array} OptionalThe array of targeted Peers to transfer the message object to. Alternatively, you may provide this parameter as a string to a specific targeted Peer to transfer the message object.
Example:
// Example 1: Send to all peers SkylinkDemo.sendP2PMessage("Hi there! This is from a DataChannel connection!"");
// Example 2: Send to specific peer SkylinkDemo.sendP2PMessage("Hi there peer! This is from a DataChannel connection!", targetPeerId);
sendStream
options
,
[callback]
,
)
Replaces the currently attached Stream object in Skylink and refreshes all connection with Peer connections to send the updated Stream object. The application may provide their own MediaStream object to send to all PeerConnections connection. Reference refreshConnection() on the events triggered and restart mechanism.
Triggers:
peerRestart, serverPeerRestart, incomingStreamParameters:
-
options
{Object | JSON}The self Stream streaming settings for the new Stream object to replace the current Stream object attached to Skylink. If this parameter is provided as a MediaStream object, the MediaStream object settings for
mediaStatus
would be detected as unmuted by default.-
audio
{Boolean | JSON} OptionalDEFAULT: falseThe self Stream streaming audio settings. If
false
, it means that audio streaming is disabled in the self Stream. If this option is set totrue
or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream audio user media access is given.-
stereo
{Boolean} OptionalDEFAULT: false The flag that indicates if stereo should be enabled in self connection Stream audio streaming. -
mute
{Boolean} OptionalDEFAULT: false The flag that indicates if the self Stream object audio streaming is muted. -
optional
{Array} OptionalThe optional constraints for audio streaming in self user media Stream object. This follows theoptional
setting in theMediaStreamConstraints
whengetUserMedia()
is invoked. Tampering this may cause errors in retrieval of self user media Stream object. Refer to this [site for more reference](http://www.sitepoint.com/introduction-getusermedia-api/).
-
-
video
{Boolean | JSON} OptionalDEFAULT: falseThe self Stream streaming video settings. If
false
, it means that video streaming is disabled in the self Stream. If this option is set totrue
or is defined with settings, getUserMedia() will be invoked. Self will not connect to the room unless the Stream video user media access is given.-
mute
{Boolean} OptionalDEFAULT: false The flag that indicates if the self Stream object video streaming is muted. -
resolution
{JSON} OptionalThe self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION] -
resolution.width
{Number} OptionalThe self Stream streaming video resolution width. -
resolution.height
{Number} OptionalThe self Stream streaming video resolution height. -
frameRate
{Number} OptionalDEFAULT: 50 The self Stream streaming video maximum frameRate. -
optional
{Array} OptionalThe optional constraints for video streaming in self user media Stream object. This follows theoptional
setting in theMediaStreamConstraints
whengetUserMedia()
is invoked. Tampering this may cause errors in retrieval of self user media Stream object. Refer to this [site for more reference](http://www.sitepoint.com/introduction-getusermedia-api/).
-
-
-
callback
{Function} OptionalThe callback fired after Skylink has replaced the current Stream object successfully with the provided media settings / MediaStream object or have met with an exception. The callback signature is
function (error, success)
.-
error
{Object}The error object received in the callback. This is the exception thrown that caused the failure for replacing the current Stream object. If received as
null
, it means that there is no errors. -
success
{Object}The success object received in the callback. The self user media MediaStream object. To display the MediaStream object to a
video
oraudio
, simply invoke:
attachMediaStream(domElement, stream);
. If received asnull
, it means that there are errors.
-
Example:
// Example 1: Send a stream object instead SkylinkDemo.on('mediaAccessSuccess', function (stream) { SkylinkDemo.sendStream(stream); });
// Example 2: Send stream with getUserMedia automatically called for you SkylinkDemo.sendStream({ audio: true, video: false });
// Example 3: Send stream with getUserMedia automatically called for you // and audio is muted SkylinkDemo.sendStream({ audio: { mute: true }, video: false });
// Example 4: Send stream with callback SkylinkDemo.sendStream({ audio: true, video: true },function(error,success){ if (error){ console.log('Error occurred. Stream was not sent: '+error) } else{ console.log('Stream successfully sent: '+success); } });
sendURLData
data
,
[timeout=60]
,
[targetPeerId]
,
[callback]
,
)
Starts a data URI transfer with Peers using the DataChannel connection.
- The receiving Peers have the option to accept or reject the data transfer with acceptDataTransfer().
- For Peers connecting from our mobile platforms
(iOS / Android),
the DataChannel connection channel type would be
DATA_CHANNEL_TYPE.MESSAGING
.
For Peers connecting from the Web platform, the DataChannel connection channel type would beDATA_CHANNEL_TYPE.DATA
.
Triggers:
incomingData, incomingDataRequest, dataTransferState, dataChannelStateParameters:
-
data
{String}The dataURL (base64 binary string) string to transfer to Peers.
-
timeout
{Number} OptionalDEFAULT: 60The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
-
targetPeerId
{String | Array} OptionalThe array of targeted Peers to transfer the data object to. Alternatively, you may provide this parameter as a string to a specific targeted Peer to transfer the data object.
-
callback
{Function} OptionalThe callback fired after all the data transfers is completed successfully or met with an exception. The callback signature is
function (error, success)
.-
error
{JSON}The error object received in the callback. If received as
null
, it means that there is no errors.-
state
{String} OptionalDEFAULT: null Deprecated. The dataTransferState when the error has occurred. This only triggers for a single targeted Peer data transfer. -
error
{Object | String} OptionalDEFAULT: null Deprecated. The error received when the data transfer fails. This only triggers for single targeted Peer data transfer. -
transferId
{String}The transfer ID of the failed data transfer. -
peerId
{String} OptionalDEFAULT: null The single targeted Peer ID for the data transfer. This only triggers for single targeted Peer data transfer. -
listOfPeers
{Array}The list of Peer that the data transfer has been initiated with. -
isPrivate
{Boolean}The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers. -
transferErrors
{JSON}The list of errors occurred based on per Peer basis. -
transferErrors.(#peerId)
{Object | String}The error that occurred when having a DataChannel connection data transfer with associated Peer. -
transferInfo
{JSON}The transfer data object information. -
transferInfo.name
{String} OptionalDEFAULT: transferId The data transfer ID. -
transferInfo.size
{Number}The transfer data size. -
transferInfo.transferId
{String}The data transfer ID. -
transferInfo.dataType
{String}The type of data transfer initiated. The received type would be"dataURL"
. -
transferInfo.timeout
{String}The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer. -
transferInfo.isPrivate
{Boolean}The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
-
-
success
{JSON}The success object received in the callback. If received as
null
, it means that there are errors.-
state
{String} OptionalDEFAULT: null Deprecated. The dataTransferState when the data transfer has been completed successfully. This only triggers for a single targeted Peer data transfer. -
transferId
{String}The transfer ID of the successful data transfer. -
peerId
{String} OptionalDEFAULT: null The single targeted Peer ID for the data transfer. This only triggers for single targeted Peer data transfer. -
listOfPeers
{Array}The list of Peer that the data transfer has been initiated with. -
isPrivate
{Boolean}The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers. -
transferInfo
{JSON}The transfer data object information. -
transferInfo.name
{String} OptionalDEFAULT: transferId The data transfer ID. -
transferInfo.size
{Number}The transfer data size. -
transferInfo.transferId
{String}The data transfer ID. -
transferInfo.dataType
{String}The type of data transfer initiated. The received type would be"dataURL"
. -
transferInfo.timeout
{String}The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer. -
transferInfo.isPrivate
{Boolean}The flag to indicate if the data transfer is a private transfer to the Peer directly and not broadcasted to all Peers.
-
-
Example:
// Example 1: Send dataURL to all peers connected SkylinkDemo.sendURLData(dataURL, 67);
// Example 2: Send dataURL to individual peer SkylinkDemo.sendURLData(dataURL, 87, targetPeerId);
// Example 3: Send dataURL with callback SkylinkDemo.sendURLData(dataURL, 87, function(error, success){ if (error){ console.error("Error happened. Could not send dataURL", error); } else{ console.info("Successfully sent dataURL"); } });
setDebugMode
[options=false]
,
)
Configures the Skylink debugging tools.
Parameters:
-
options
{Boolean | JSON} OptionalDEFAULT: falseThe debugging settings for Skylink. If provided options is a typeof
boolean
,storeLogs
andtrace
will be set totrue
.-
trace
{Boolean} OptionalDEFAULT: falseThe flag that indicates if Skylink console logs should all output as
console.trace()
. Ifconsole.trace()
is not supported, it will fallback and output asconsole.log()
. -
storeLogs
{Boolean} OptionalDEFAULT: falseThe flag that indicates if Skylink should store the logs in SkylinkLogs.
-
Example:
// Example 1: just to enable SkylinkDemo.setDebugMode(true); // or SkylinkDemo.setDebugMode();
// Example 2: just to disable SkylinkDemo.setDebugMode(false);
// Example 3: disable storeLogs or trace feature individually SkylinkDemo.setDebugMode({ trace: true });
setLogLevel
[logLevel]
,
)
Configures the Skylink console log level that would determine the type of console logs that would be printed in the Web console.
Parameters:
-
logLevel
{Number} OptionalThe log level of console message logs to be printed in the Web console. [Rel: Skylink.LOG_LEVEL]
Example:
//Display logs level: Error, warn, info, log and debug. SkylinkDemo.setLogLevel(SkylinkDemo.LOG_LEVEL.DEBUG);
setUserData
userData
,
)
Sets the current custom user data information for self.
This sets and overwrites the peerInfo.userData
value for self.
If self is in the room and connected with other peers, the peers will be notified
with the peerUpdated event.
You may get the current customer user data information for self in
getUserData().
Triggers:
peerUpdatedParameters:
-
userData
{JSON | String}The custom (or updated) user data information for self provided.
Example:
// Example 1: Intial way of setting data before user joins the room SkylinkDemo.setUserData({ displayName: "Bobby Rays", fbUserId: "1234" });
// Example 2: Way of setting data after user joins the room var userData = SkylinkDemo.getUserData(); userData.displayName = "New Name"; userData.fbUserId = "1234"; SkylinkDemo.setUserData(userData);
stopScreen
()
Stops self screensharing Stream object attached to Skylink. If user media Stream object is available, Skylink will refresh all Peer connections to send the user media Stream object. Reference refreshConnection() on the events triggered and restart mechanism.
Triggers:
mediaAccessStopped, streamEnded, incomingStream, peerRestart, serverPeerRestartExample:
SkylinkDemo.stopScreen();
stopStream
()
Stops self user media Stream object attached to Skylink.
Triggers:
mediaAccessStopped, streamEndedExample:
SkylinkDemo.stopStream();
unlockRoom
()
Unlocks the currently connected room to allow other peers to join the room.
Triggers:
roomLockExample:
SkylinkDemo.unlockRoom();
log.debug
()
Handles the console.debug
console log message.
Parameters:
-
message
{Array | String}The console log message contents.
-
0
{String} OptionalThe Peer ID the message is associated with.
-
debugObject
{Object | String} OptionalThe console debugging message object to accompany and display that associates with the console log message.
Example:
// Logging for message log.debug("This is my message", object);
log.error
()
Handles the console.error
console log message.
Parameters:
-
message
{Array | String}The console log message contents.
-
0
{String} OptionalThe Peer ID the message is associated with.
-
debugObject
{Object | String} OptionalThe console debugging message object to accompany and display that associates with the console log message.
Example:
// Logging for external information log.error("There has been an error", object);
log.info
()
Handles the console.info
console log message.
Parameters:
-
message
{Array | String}The console log message contents.
-
0
{String} OptionalThe Peer ID the message is associated with.
-
debugObject
{Object | String} OptionalThe console debugging message object to accompany and display that associates with the console log message.
Example:
// Logging for message log.debug("This is my message", object);
log.log
()
Handles the console.log
console log message.
Parameters:
-
message
{Array | String}The console log message contents.
-
0
{String} OptionalThe Peer ID the message is associated with.
-
debugObject
{Object | String} OptionalThe console debugging message object to accompany and display that associates with the console log message.
Example:
// Logging for message log.log("This is my message", object);
log.warn
()
Handles the console.warn
console log message.
Parameters:
-
message
{Array | String}The console log message contents.
-
0
{String} OptionalThe Peer ID the message is associated with.
-
debugObject
{Object | String} OptionalThe console debugging message object to accompany and display that associates with the console log message.
Example:
// Logging for message log.debug("Here's a warning. Please do xxxxx to resolve this issue", object);
SkylinkLogs
()
The object that handles the stored Skylink console logs.
- setDebugMode()
storeLogs
flag must be set astrue
to enable the storage of logs.
SkylinkLogs.clearAllLogs
()
Clears the stored Skylink console logs.
Parameters:
-
logLevel
{Number} OptionalThe specific log level of Skylink console logs that should be cleared. If value is not provided, it will clear all stored console logs. [Rel: Skylink.LOG_LEVEL]
Example:
SkylinkLogs.clearAllLogs(); // empties all logs
SkylinkLogs.getLogs
()
Gets the stored Skylink console logs.
Parameters:
-
logLevel
{Number} OptionalThe specific log level of Skylink console logs that should be returned.
If value is not provided, it will return all stored console logs. [Rel: Skylink.LOG_LEVEL]
Returns:
The array of stored console logs based on the log level provided.
Example:
// Example 1: Get logs of specific level var debugLogs = SkylinkLogs.getLogs(SkylinkDemo.LOG_LEVEL.DEBUG);
// Example 2: Get all logs var allLogs = SkylinkLogs.getLogs();
SkylinkLogs.printAllLogs
()
Prints all the stored Skylink console logs into the Web console.
Example:
SkylinkLogs.printAllLogs(); // check the console
_appKeyOwner
Attribute Type: {String}
Stores the Skylink server Application Key owner string for the selected room.
_audioFallback
Attribute Type: {Boolean}
The flag indicates that when Skylink tries to get both audio and video stream but Skylink fails to retrieve the user media stream, it should fallback to retrieve audio streaming for the user media stream only.
Default value:
false
_autoIntroduce
Attribute Type: {Boolean}
Whether this user automatically introduce to other peers.
Default value:
true
_channelOpen
Attribute Type: {Boolean}
The flag that indicates if the current socket connection with platform signaling is opened.
_CHUNK_DATAURL_SIZE
Attribute Type: {Number}
The fixed data chunk size for
dataURL
(which is a binary string (base64) and known as data URIs)
data transfers using DataChannel connection.
_CHUNK_FILE_SIZE
Attribute Type: {Number}
The fixed data chunk size for
Blob
data transfers using DataChannel connection.
_dataChannels
Attribute Type: {JSON}
Stores the list of DataChannel connections.
Keys:
-
(#peerId)
{Array}The Peer ID associated with the list of DataChannel connections.
-
main
{Object}The DataChannel connection object that is used for messaging only associated with the Peer connection. This is the sole channel for sending P2P messages in sendP2PMessage(). This connection will always be kept alive until the Peer connection has ended. The
channelName
for this reserved key is"main"
. -
(#channelName)
{Object}The DataChannel connection object that is used temporarily for a data transfer associated with the Peer connection. This is using caused by methods sendBlobData() and sendURLData(). This connection will be closed once the transfer has completed or terminated. The
channelName
is usually the data transfer ID.
-
_dataTransfersTimeout
Attribute Type: {JSON}
Stores the list of ongoing data transfer timeouts using the
setTimeout
objects for each DataChannel connection transfer.
Keys:
-
(#channelName)
{Object}The timeout for the associated DataChannel connection.
_DC_PROTOCOL_TYPE
Attribute Type: {JSON}
The list of Protocol types that is used for transfers and messaging using the DataChannel connection.
Keys:
-
WRQ
{String}Protocol to initiate a transfer request on the current DataChannel connection. Data transfer step 1.
-
ACK
{String}Protocol to accept or reject the transfer request. Data transfer step 2.
-
DATA
{String}Actual binary data or string send based on the
ackN
in theACK
packet received. Data transfer step 3. This may not occur is step 2 is rejected. -
CANCEL
{String}Protocol to terminate an ongoing transfer. This data transfer step can happen after step 2 or 3.
-
ERROR
{String}Protocol that is sent when a transfer occurs an exception which using causes it to be terminated. This data transfer step can happen after step 2 or 3.
-
MESSAGE
{String}Protocol that is used to send P2P message objects over the DataChannel connection. This is not related to any data transfer step, but for messaging purposes.
_defaultRoom
Attribute Type: {String}
Stores the default room that is configured in the init(). If no room is provided in joinRoom(), this is the room that self would join to by default. If the value is not provided in init(), by default, the value is the Application Key that is configured in init().
Default value:
Skylink._appKey
_defaultStreamSettings
Attribute Type: {JSON}
Stores the Skylink default streaming settings.
Keys:
-
audio
{Boolean | JSON} OptionalThe default streaming audio settings. If
false
, it means that audio streaming is disabled in self connection Stream.-
stereo
{Boolean} OptionalThe default flag that indicates if stereo should be enabled in self connection Stream audio streaming.
-
-
video
{Boolean | JSON} OptionalThe default streaming video settings. If
false
, it means that video streaming is disabled in the remote Stream of the Peer.-
resolution
{JSON} OptionalThe default streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
-
width
{Number} OptionalThe default streaming video resolution width. -
height
{Number} OptionalThe default streaming video resolution height.
-
-
frameRate
{Number} OptionalThe default streaming video maximum frameRate.
-
-
bandwidth
{String} OptionalThe default streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
-
audio
{String} OptionalThe default audio stream channel for self Stream object bandwidth that audio streaming should use in kb/s.
-
video
{String} OptionalThe default video stream channel for self Stream object bandwidth that video streaming should use in kb/s.
-
data
{String} OptionalThe default datachannel channel for self DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
-
_downloadDataSessions
Attribute Type: {JSON}
Stores the list of ongoing data transfer state informations that is received from the sender point in a DataChannel connection based on the associated DataChannel ID.
Keys:
-
(#channelName)
{JSON}The ongoing data transfer information that is sent to receiving end associated with the DataChannel connection.
-
name
{String}The data transfer name.
-
size
{Number}The expected data size of the completed data transfer.
-
isUpload
{Boolean}The flag that indicates if the transfer is an upload data transfer. In this case, the value should be
false
. -
senderPeerId
{String}The Peer uploader ID.
-
transferId
{String}The data transfer ID.
-
percentage
{Number}The data transfer percentage.
-
timeout
{Number}The data transfer timeout to wait for response before throwing a timeout error.
-
chunkSize
{Number}The data transfer packet (chunk) size.
-
dataType
{String}The data transfer packet (chunk) data type.
-
_downloadDataTransfers
Attribute Type: {JSON}
Stores the list of ongoing data transfers data packets (chunks) to be received from sending point in a DataChannel connection based on the associated DataChannel ID.
Keys:
-
(#channelName)
{Array}The ongoing data transfer packets received associated with DataChannel.
-
(#index)
{Blob | String}The packet index of chunked Blob data object or dataURL string (base64 binary string) received from sending point.
-
_enableDataChannel
Attribute Type: {Boolean}
The flag that indicates if Peers connection should have any DataChannel connections.
Default value:
true
_enableDebugMode
Attribute Type: {Boolean}
The flag that indicates if Skylink debugging mode is enabled.
This is not to be confused with setLogLevel()
functionality, as that touches the output Web console log levels, and this
enables the debugging trace of the logs console.trace()
or storage of the console logs.
Default value:
false
_enableDebugStack
Attribute Type: {Boolean}
The flag that indicates if Skylink should store the logs in _storedLogs.
Default value:
false
_enableDebugTrace
Attribute Type: {Boolean}
The flag that indicates if Skylink console logs should all output as
console.trace()
.
If console.trace()
is not supported, it will fallback and
output as console.log()
.
Default value:
false
_enableIceTrickle
Attribute Type: {Boolean}
The flag that indicates if PeerConnections should enable trickling of ICE to connect the ICE connection.
Default value:
true
_enableSTUN
Attribute Type: {Boolean}
The flag that indicates if PeerConnections ICE gathering should use STUN server connection.
Default value:
true
_enableTURN
Attribute Type: {Boolean}
The flag that indicates if PeerConnections ICE gathering should use TURN server connection. Tampering this flag may disable any successful Peer connection that is behind any firewalls.
Default value:
true
_EVENTS
Attribute Type: {JSON}
Stores the list of on() event subscription handlers.
Keys:
-
(#eventName)
{Array}The array of event subscription handlers that is subscribed using on() method associated with the event name.
-
(#index)
{Function}The event subscription handler associated with the event name. This is to be triggered multiple times until off() is invoked for this event subscription handler.
-
_forceSSL
Attribute Type: {Boolean}
The flag to enforce an SSL platform signaling and platform server connection.
If self domain accessing protocol is https:
, SSL connections
would be automatically used. This flag is mostly used for self domain accessing protocol
that is http:
and enforcing the SSL connections for
platform signaling and platform server connection.
Default value:
false
_forceTURN
Attribute Type: {Boolean}
The flag to enforce TURN server connection for quicker connectivity.
Default value:
false
_forceTURNSSL
Attribute Type: {Boolean}
The flag to enforce an SSL TURN server connection.
If self domain accessing protocol is https:
, SSL connections
would be automatically used. This flag is mostly used for self domain accessing protocol
that is http:
and enforcing the SSL connections for
TURN server connection.
This will configure TURN server connection using port 443
only and
if turns:
protocol is supported, it will use turns:
protocol.
Default value:
false
_getUserMediaSettings
Attribute Type: {JSON}
Stores the getUserMedia MediaStreamConstraints parsed from _streamSettings for user media Stream object.
Keys:
-
audio
{Boolean | JSON} OptionalThe flag that indicates if self user media MediaStream would have audio streaming.
-
optional
{Array} OptionalThe optional constraints for audio streaming in self user media MediaStream object. Some of the values are set by the
audio.optional
setting in getUserMedia().
-
-
video
{Boolean | JSON} OptionalThe flag that indicates if self user media MediaStream would have video streaming.
-
mandatory.maxHeight
{Number} OptionalThe self user media MediaStream video streaming resolution maximum height.
-
mandatory.maxWidth
{Number} OptionalThe self user media MediaStream video streaming resolution maximum width.
-
mandatory.maxFrameRate
{Number} OptionalThe self user media MediaStream video streaming maxinmum framerate.
-
optional
{Array} OptionalThe optional constraints for video streaming in self user media MediaStream object. Some of the values are set by the
video.optional
setting in getUserMedia().
-
_groupMessageList
Attribute Type: {Array}
Stores the list of types of socket messages that requires to be queued or bundled before sending to the server to prevent platform signaling from dropping of socket messages.
_hasMCU
Attribute Type: {Boolean}
The flag that indicates if MCU is in the room and is enabled.
Default value:
false
_ICEConnectionFailures
Attribute Type: {JSON}
Stores the list of Peer connection ICE connection failures. After an third attempt of ICE connection failure, the trickling of ICE would be disabled.
Keys:
-
(#peerId)
{Number}The Peer ID associated with the number of Peer connection ICE connection attempt failures.
_INTEROP_MULTI_TRANSFERS
Attribute Type: {Array}
The list of platforms that Skylink should fallback to use the
DATA_CHANNEL_TYPE.MESSAGING
channel for transfers instead of using multi-transfers
due to the lack of support in the platform implementations.
_lastRestart
Attribute Type: {Object}
Stores the timestamp of the moment when the last Peers connection restarts has happened. Used for the restart Peers connection functionality.
_LOG_KEY
Attribute Type: {String}
The format string that is printed in every Skylink console logs for Skylink logs identification.
Example: "SkylinkJS - <
_logLevel
Attribute Type: {String}
Stores the current Skylink log level.
By default, the value is ERROR
.
Default value:
Skylink.LOG_LEVEL.ERROR
_mediaScreenClone
Attribute Type: {Object}
Stores the self screensharing audio MediaStream
for browsers that do not support bundling of
screensharing MediaStream with audio: true
.
The current _mediaScreen
clones this MediaStream object and .addTrack()
with the
screensharing MediaStream object video MediaStreamTrack object.
_mediaStreamsStatus
Attribute Type: {JSON}
Stores self Stream mute settings for both audio and video streamings.
Keys:
-
audioMuted
{Boolean} OptionalThe flag that indicates if self connection Stream object audio streaming is muted. If there is no audio streaming enabled for self connection, by default, it is set to
true
. -
videoMuted
{Boolean} OptionalThe flag that indicates if self connection Stream object video streaming is muted. If there is no video streaming enabled for self connection, by default, it is set to
true
.
_MOZ_CHUNK_FILE_SIZE
Attribute Type: {Number}
The fixed data chunk size for
Blob
data type for transfers using DataChanel connection on
Firefox based browsers.
Limitations is different for Firefox as tested in some PCs (linux predominantly)
that sending a packet size of 49152
kb from another browser
reflects as 16384
kb packet size when received.
_onceEvents
Attribute Type: {JSON}
Stores the list of once() event subscription handlers.
Keys:
-
(#eventName)
{Array}The array of event subscription handlers that is subscribed using once() method associated with the event name.
-
(#index)
{Function}The event subscription handler associated with the event name. This is to be triggered once when condition is met. Alternatively, the
once()
event subscription handler can be unsubscribed with off() before condition is met.
-
_parentKey
Attribute Type: {String}
Parent key in case the current key is alias. If the current key is not alias, this is the same as _appKey
Default value:
null
_path
Attribute Type: {String}
The constructed REST path that Skylink makes a HTTP /GET
from
to retrieve the connection information required.
_peerCandidatesQueue
Attribute Type: {JSON}
Stores the list of buffered ICE candidates received
before RTCPeerConnection.setRemoteDescription
is
called. Adding ICE candidates before receiving the remote
session description causes an ICE connection failures in a
number of instances.
Keys:
-
(#peerId)
{Array}The Peer ID associated with the list of buffered ICE candidates.
-
(#index)
{Object}The buffered RTCIceCandidate object associated with the Peer.
-
_peerConnectionHealth
Attribute Type: {JSON}
Stores the list of Peer connections that has connection
established successfully. When the Peer connection has a
successful ICE connection state of "completed"
,
it stores the Peer connection as "healthy".
Keys:
-
(#peerId)
{Boolean}The flag that indicates if the associated Peer connection is in a "healthy" state. If the value is
true
, it means that the Peer connectin is in a "healthy" state.
_peerConnectionHealthTimers
Attribute Type: {JSON}
Stores the list of Peer connection health timeout objects that waits for any existing Peer "healthy" state in successful _peerConnectionHealth. If timeout has reached it's limit and does not have any "healthy" connection state with Peer connection, it will restart the connection again with _restartPeerConnection().
Keys:
-
(#peerId)
{Object}The timeout object set using
setTimeout()
that does the wait for any "healthy" state connection associated with the Peer connection. This will be removed when the Peer connection has ended or when the Peer connection has been met with a "healthy" state.
_peerConnections
Attribute Type: {JSON}
Stores the list of Peers connection.
Keys:
-
(#peerId)
{Object}The Peer ID associated to the RTCPeerConnection object.
_peerHSPriorities
Attribute Type: {JSON}
Stores the list of Peer handshake connection weights.
This is implemented to prevent the conflict of sending WELCOME
to peer and receiving WELCOME
from peer at the same time.
To handle this event, both self and the peer has to generate a weight initially.
Then in the Skylink/_welcomeHandler:attr
when conflict WELCOME
message is received, the handler woudl check
if there is already an existing Peer connection object with the peer (due
to the initialisation in the received ENTER
). If so the handler would
then compare the received weight if it is higher than the weight generated for this peer.
The one with the highest weight would have the "priority" to initiate the WebRTC layer of
handshake and start sending the OFFER
session description.
Keys:
-
(#peerId)
{Number}The generated weight for associated Peer peer. The weight is generated with
Date.getTime()
.
_peerIceTrickleDisabled
Attribute Type: {JSON}
Stores the list of flags associated to the PeerConnections to disable trickle ICE as attempting to establish an ICE connection failed after many trickle ICE connection attempts. To ensure the stability and increase the chances of a successful ICE connection, track the Peer connection and store it as a flag in this list to disable trickling of ICE connections.
Keys:
-
(#peerId)
{Boolean}The Peer trickle ICE disabled flag. If value is
true
, it means that trickling of ICE is disabled for subsequent connection attempt.
_peerInformations
Attribute Type: {JSON}
Stores the list of all Peers information.
Keys:
-
(#peerId)
{JSON}The Peer ID associated with the information.
-
userData
{String | JSON}The custom user data information set by developer. This custom user data can also be set in setUserData().
-
settings
{JSON}The Peer Stream streaming settings information. If both audio and video option is
false
, there should be no receiving remote Stream object from this associated Peer.-
audio
{Boolean | JSON} OptionalThe Peer Stream streaming audio settings. Iffalse
, it means that audio streaming is disabled in the remote Stream of the Peer. -
audio.stereo
{Boolean} OptionalThe flag that indicates if stereo should be enabled in the Peer connection Stream audio streaming. -
video
{Boolean | JSON} OptionalThe Peer Stream streaming video settings. Iffalse
, it means that video streaming is disabled in the remote Stream of the Peer. -
video.resolution
{JSON} OptionalThe Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Number} OptionalThe Peer Stream streaming video resolution width. -
video.resolution.height
{Number} OptionalThe Peer Stream streaming video resolution height. -
video.frameRate
{Number} OptionalThe Peer Stream streaming video maximum frameRate. -
video.screenshare
{Boolean} OptionalThe flag that indicates if the Peer connection Stream object sent is a screensharing stream or not. -
bandwidth
{String} OptionalThe Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s. -
bandwidth.audio
{String} OptionalThe configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s. -
bandwidth.video
{String} OptionalThe configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s. -
bandwidth.data
{String} OptionalThe configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
-
-
mediaStatus
{JSON}The Peer Stream mute settings for both audio and video streamings.
-
audioMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set totrue
. -
videoMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set totrue
.
-
-
agent
{JSON}The Peer platform agent information.
-
name
{String}The Peer platform browser or agent name. -
version
{Number}The Peer platform browser or agent version. -
os
{Number}The Peer platform name.
-
-
_peerRestartPriorities
Attribute Type: {JSON}
Stores the list of Peer connection restart weights received that would be compared against to indicate if Peer connection should initiates a restart from the other connection end should. The one that sends restart later is the one who initiates the restart.
Keys:
-
(#peerId)
{Number}The Peer ID associated with the connection restart handshake reconnection weights. The weight is generated with
Date.valueOf()
.
_readyState
Attribute Type: {Number}
Stores the current Skylink room connection retrieval ready state. [Rel: Skylink.READY_STATE_CHANGE]
_receiveOnly
Attribute Type: {Boolean}
The flag that indicates that the current self connection should only receive streaming Stream objects from other Peer connection and not send streaming Stream objects to other Peer connection.
Default value:
false
_retryCount
Attribute Type: {Number}
Stores the counter of the number of consecutive Peers connection restarts retries.
_room
Attribute Type: {JSON}
Stores the room connection information that is passed for starting the selected room connection. Some of these information are also used and required to send for every messages sent to the platform signaling connection for targeting the correct room and self identification in the room.
Keys:
-
id
{String}The room ID for identification to the platform signaling connection.
-
token
{String}The generated room token given by the platform server for starting the platform signaling connection.
-
startDateTime
{String}The start datetime stamp (in The startDateTime in (ISO 8601 format) that the call has started sent by the platform server as an indication for the starting datetime of the platform signaling connection to self.
-
duration
{String}The duration of the room meeting (in hours). This duration will not affect non persistent room.
-
connection
{JSON}Connection The RTCPeerConnection constraints and configuration.
-
peerConstraints
{JSON}Deprecated feature. The RTCPeerConnection constraints that is passed in this format
new RTCPeerConnection(config, constraints);
. This feature is not documented in W3C Specification draft and not advisable to use. -
peerConfig
{JSON}The RTCPeerConnection RTCConfiguration.
-
offerConstraints
{JSON}Deprecated feature. The RTCPeerConnection RTCOfferOptions used in
RTCPeerConnection.createOffer(successCb, failureCb, options);
. -
sdpConstraints
{JSON}Not in use. The RTCPeerConnection RTCAnswerOptions to be used in
RTCPeerConnection.createAnswer(successCb, failureCb, options);
. This is currently not in use due to not all browsers supporting this feature yet. -
mediaConstraints
{JSON}Deprecated feature. The getUserMedia() MediaStreamConstraints in
getUserMedia(constraints, successCb, failureCb);
.
-
_roomCredentials
Attribute Type: {String}
Stores the room credentials for Application Key. This is required for rooms connecting without CORS verification or starting a new persistent room meeting. To generate the credentials:
- Concatenate a string that consists of the room name
the room meeting duration (in hours) and the start date timestamp (in ISO 8601 format).
Format
room + duration + startDateTimeStamp
. - Hash the concatenated string with the Application Key token using
SHA-1.
You may use the CryptoJS.HmacSHA1 function to do so.
Example
var hash = CryptoJS.HmacSHA1(concatenatedString, token);
. - Convert the hash to a Base64 encoded string. You may use the
CryptoJS.enc.Base64 function
to do so. Example
var base64String = hash.toString(CryptoJS.enc.Base64);
. - Encode the Base64 encoded string to a URI component using UTF-8 encoding with
encodeURIComponent().
Example
var credentials = encodeURIComponent(base64String);
and the duration.
_roomDuration
Attribute Type: {Number}
Stores the new persistent room meeting duration (in hours) that the current new meeting duration should be in the room that was selected to join. The duration will not affect non persistent room connection. The persistent room feature is configurable in the Application Key in the developer console.
_roomLocked
Attribute Type: {Boolean}
The flag that indicates if the currently joined room is locked.
_roomServer
Attribute Type: {String}
The platform server URL that Skylink can construct the REST path with to make
a HTTP /GET
to retrieve the connection information required.
If the value is not the default value, it's mostly for debugging purposes.
It's not advisable to allow developers to set the custom server URL unless
they are aware of what they are doing, as this is a debugging feature.
Default value:
"//api.temasys.com.sg"
_roomStart
Attribute Type: {String}
Stores the new persistent room meeting start datetime stamp in (ISO 8601 format). This will start a new meeting based on the starting datetime stamp in the room that was selected to join. The start date time of the room will not affect non persistent room connection. The persistent room feature is configurable in the Application Key in the developer console.
_screenSharingAvailable
Attribute Type: {Boolean}
The flag that indicates if self browser supports the screensharing feature. Currently, Opera does not support screensharing and only premium Temasys plugins support this screensharing feature.
Default value:
false
_screenSharingStreamSettings
Attribute Type: {JSON}
Stores self screensharing Stream streaming settings.
Keys:
-
audio
{Boolean | JSON} OptionalThe self Stream streaming audio settings. If
false
, it means that audio streaming is disabled in the remote Stream of self connection.-
stereo
{Boolean} OptionalThe flag that indicates if stereo should be enabled in self connection Stream audio streaming.
-
-
video
{Boolean | JSON}The self Stream streaming video settings.
-
screenshare
{Boolean} OptionalThe flag that indicates if the self connection Stream object sent is a screensharing stream or not. In this case, the value is
true
for screensharing Stream object.
-
-
bandwidth
{String} OptionalThe self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
_selectedAudioCodec
Attribute Type: {String}
Stores the preferred Peer connection streaming audio codec.
Default value:
Skylink.AUDIO_CODEC.AUTO
_selectedRoom
Attribute Type: {String}
Stores the current room self is joined to. The selected room will be usually defaulted to _defaultRoom if there is no selected room in joinRoom().
Default value:
Skylink._defaultRoom
_selectedVideoCodec
Attribute Type: {String}
Stores the preferred Peer connection streaming video codec.
Default value:
Skylink.VIDEO_CODEC.AUTO
_serverRegion
Attribute Type: {String}
The regional server that Skylink should connect to for fastest connectivity.
_SIG_MESSAGE_TYPE
Attribute Type: {JSON}
The list of Protocol types that is used for messaging using the platform signaling socket connection.
Keys:
-
JOIN_ROOM
{String}Protocol sent from Skylink to platform signaling to let self join the room. Join room Step 1.
-
IN_ROOM
{String}Protocol received from platform signaling to inform Skylink that self has joined the room. Join room Step 2 (Completed).
-
ENTER
{String}Protocol Skylink sends to all Peer peers in the room to start handshake connection. Handshake connection Step 1.
-
WELCOME
{String}Protocol received to Peer as a response to self
ENTER
message. This is sent as a response to PeerENTER
message. Handshake connection Step 2. -
OFFER
{String}Protocol sent to Peer as a response to the
WELCOME
message received after generating the offer session description withRTCPeerConnection.createOffer()
. This is received as a response from Peer after sendingWELCOME
message and requires setting into the Peer connection before sending theANSWER
response. Handshake connection Step 3. -
ANSWER
{String}Protocol received from Peer as a response to self
OFFER
message offer session description and requires setting into the Peer connection. This is sent to Peer as a response to theOFFER
message received after setting the receivedOFFER
message and generating the answer session description withRTCPeerConnection.createAnswer()
. Handshake connection Step 4 (Completed). -
CANDIDATE
{String}Protocol received from Peer when connection ICE candidate has been generated and requires self to add to the Peer connection.
-
BYE
{String}Protocol received from platform signaling when a Peer has left the room.
-
REDIRECT
{String}Protocol received from platform signaling when self is kicked out from the currently joined room.
-
UPDATE_USER
{String}Protocol received when a Peer information has been updated. The message object should contain the updated peer information. This is broadcasted by self when self peer information is updated.
-
ROOM_LOCK
{String}Protocol received when the current joined room lock status have been updated. The message object should contain the updated room lock status. This is broadcasted by self when self updates the room lock status.
-
MUTE_VIDEO
{String}Protocol received when a Peer Stream video media streaming muted status have been updated. The message object should contain the updated Stream video media streaming muted status. This is broadcasted by self when self Stream video media streaming muted status have been updated.
-
MUTE_AUDIO
{String}Protocol received when a Peer connection Stream audio media streaming muted status have been updated. The message object should contain the updated Stream audio media streaming muted status. This is broadcasted by self when self Stream audio media streaming muted status have been updated.
-
PUBLIC_MESSAGE
{String}Protocol received when a Peer broadcasts a message object to all Peer peers via the platform signaling socket connection. This is broadcasted by self when self sends the message object.
-
PRIVATE_MESSAGE
{String}Protocol received when a Peer sends a message object targeted to several Peer peers via the platform signaling socket connection. This is sent by self when self sends the message object.
-
RESTART
{String}Protocol received when a Peer connection requires a reconnection. At this point, the Peer connection have to recreate the
RTCPeerConnection
object again. This is sent by self when self initiates the reconnection. -
STREAM
{String}Protocol received when a Peer connection Stream status have changed.
-
GET_PEERS
{String}Protocol for privileged self to get the list of Peer peers under the same parent Application Key.
-
PEER_LIST
{String}Protocol to retrieve a list of peers under the same parent.
-
INTRODUCE
{String}Protocol sent to the platform signaling to introduce Peer peers to each other.
-
INTRODUCE_ERROR
{String}Protocol received when Peer peers introduction failed.
-
APPROACH
{String}Protocol to indicate that a Peer has been introduced. At this point, self would send an
ENTER
to introduced Peer to start the handshake connection. -
GROUP
{String}Protocol received that bundles messages together when socket messages are sent less than 1 second interval apart from the previous sent socket message. This would prevent receiving
REDIRECT
from the platform signaling.
_signalingServer
Attribute Type: {String}
Stores the platform signaling endpoint URI to open socket connection with.
_signalingServerPort
Attribute Type: {Number}
Stores the current platform signaling port to open socket connection with.
_signalingServerProtocol
Attribute Type: {String}
Stores the current platform signaling protocol to open socket connection with.
_socket
Attribute Type: {Object}
Stores the socket.io-client io
object that
handles the middleware socket connection with platform signaling.
_socketMessageQueue
Attribute Type: {Array}
Stores the queued socket messages to sent to the platform signaling to prevent messages from being dropped due to messages being sent in less than a second interval.
_socketMessageTimeout
Attribute Type: {Object}
Limits the socket messages being sent in less than a second interval
using the setTimeout
object to prevent messages being sent
in less than a second interval.
The messaegs are stored in
_socketMessageQueue.
_socketPorts
Attribute Type: {JSON}
Stores the list of fallback ports that Skylink can attempt to establish a socket connection with platform signaling.
Keys:
-
http://
{Array}The array of
HTTP
protocol fallback ports. By default, the ports are[80, 3000]
. -
https://
{Array}The The array of
HTTP
protocol fallback ports. By default, the ports are[443, 3443]
.
_socketTimeout
Attribute Type: {Number}
Stores the timeout (in ms) set to await in seconds for response from platform signaling
before throwing a connection timeout exception when Skylink is attemtping
to establish a connection with platform signaling.
If the value is 0
, it will use the default timeout from
socket.io-client that is in 20000
.
Default value:
0
_socketUseXDR
Attribute Type: {Boolean}
The flag that indicates if the current socket connection for
transports types with "Polling"
uses
XDomainRequest.aspx)
instead of XMLHttpRequest
due to the IE 8 / 9 XMLHttpRequest
not supporting CORS access.
Default value:
false
_streamSettings
Attribute Type: {JSON}
Stores self user media Stream streaming settings. If both audio and video
option is false
, there should be no
receiving remote Stream object from self connection.
Keys:
-
audio
{Boolean | JSON} OptionalThe self Stream streaming audio settings. If
false
, it means that audio streaming is disabled in the remote Stream of self connection.-
stereo
{Boolean} OptionalThe flag that indicates if stereo should be enabled in self connection Stream audio streaming.
-
optional
{Array} OptionalThe optional constraints for audio streaming in self user media Stream object. Some of the values are set by the
audio.optional
setting in getUserMedia().
-
-
video
{Boolean | JSON} OptionalThe self Stream streaming video settings. If
false
, it means that video streaming is disabled in the remote Stream of self connection.-
resolution
{JSON} OptionalThe self Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION]
-
width
{Number} OptionalThe self Stream streaming video resolution width. -
height
{Number} OptionalThe self Stream streaming video resolution height.
-
-
frameRate
{Number} OptionalThe self Stream streaming video maximum frameRate.
-
screenshare
{Boolean} OptionalThe flag that indicates if the self connection Stream object sent is a screensharing stream or not. In this case, the value is
false
for user media Stream object. -
optional
{Array} OptionalThe optional constraints for video streaming in self user media Stream object. Some of the values are set by the
video.optional
setting in getUserMedia().
-
-
bandwidth
{String} OptionalThe self streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s.
-
audio
{String} OptionalThe configured audio stream channel for self connection Stream object bandwidth that audio streaming should use in kb/s.
-
video
{String} OptionalThe configured video stream channel for the self connection Stream object bandwidth that video streaming should use in kb/s.
-
data
{String} OptionalThe configured datachannel channel for self DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
-
_TRANSFER_DELIMITER
Attribute Type: {String}
The fixed delimiter that is used in Skylink to concat the DataChannel channelName and the actual transfer ID together based on the transfer ID provided in dataTransferState.
_TURNTransport
Attribute Type: {String}
Stores the TURN server transport to enable for TURN server connections. [Rel: Skylink.TURN_TRANSPORT]
Default value:
Skylink.TURN_TRANSPORT.ANY
_uploadDataSessions
Attribute Type: {JSON}
Stores the list of ongoing data transfer state informations that is sent to receiving end in a DataChannel connection based on the associated DataChannel ID.
Keys:
-
(#channelName)
{JSON}The ongoing data transfer information that is sent to receiving end associated with the DataChannel connection.
-
name
{String}The data transfer name.
-
size
{Number}The expected data size of the completed data transfer.
-
isUpload
{Boolean}The flag that indicates if the transfer is an upload data transfer. In this case, the value should be
true
. -
senderPeerId
{String}The Peer uploader ID.
-
transferId
{String}The data transfer ID.
-
percentage
{Number}The data transfer percentage.
-
timeout
{Number}The data transfer timeout.
-
chunkSize
{Number}The data transfer packet (chunk) size.
-
dataType
{String}The data transfer packet (chunk) data type.
-
_uploadDataTransfers
Attribute Type: {JSON}
Stores the list of ongoing data transfers data packets (chunks) to be sent to receiving end in a DataChannel connection based on the associated DataChannel ID.
Keys:
-
(#channelName)
{Array}The ongoing data transfer packets to be sent to receiving end associated with the DataChannel connection.
-
(#index)
{Blob | String}The packet index of chunked Blob data object or dataURL string (base64 binary string) to be sent to received end.
-
_usePublicSTUN
Attribute Type: {Boolean}
The flag to enable using of public STUN server connections.
Default value:
true
_user
Attribute Type: {JSON}
Stores the self credentials that is required to connect to Skylink platform signalling and identification in the signalling socket connection.
Keys:
-
uid
{String}The self session ID.
-
sid
{String}The self session socket connection ID. This is used by the signalling socket connection as ID to target self and the peers Peer ID.
-
timeStamp
{String}The self session timestamp.
-
token
{String}The self session access token.
_userData
Attribute Type: {JSON | String}
Stores the custom user data information set by developer for self.
By default, if no custom user data is set, it is an empty string ""
.
Default value:
""
AUDIO_CODEC
Attribute Type: {JSON}
These are the list of available audio codecs settings that Skylink would use when streaming audio stream with Peers.
- The audio codec would be used if the self and Peer's browser supports the selected codec.
- This would default to the browser selected codec. In most cases, option
OPUS
is used by default.
Keys:
-
AUTO
{String}DEFAULT | Value
"auto"
The option to let Skylink use any audio codec selected by the browser generated session description. -
OPUS
{String}Value
"opus"
The option to let Skylink use the OPUS) codec.
This is the common and mandantory audio codec used. -
ISAC
{String}Value
"ISAC"
The option to let Skylink use the iSAC.
This only works if the browser supports the iSAC video codec.
CANDIDATE_GENERATION_STATE
Attribute Type: {JSON}
The list of Peer connection ICE candidate generation states that Skylink would trigger.
- These states references the w3c WebRTC Specification Draft.
Keys:
-
NEW
{String}Value
"new"
The state when the object was just created, and no networking has occurred yet.
This state occurs when Peer connection has just been initialised. -
GATHERING
{String}Value
"gathering"
The state when the ICE engine is in the process of gathering candidates for connection.
This state occurs afterNEW
state. -
COMPLETED
{String}Value
"completed"
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.
This state occurs afterGATHERING
state and means ICE gathering has been done.
DATA_CHANNEL_STATE
Attribute Type: {JSON}
These are the list of DataChannel connection states that Skylink would trigger.
- Some of the state references the w3c WebRTC Specification Draft,
except the
ERROR
state, which is an addition provided state by Skylink to inform exception during the DataChannel connection with Peers.
Keys:
-
CONNECTING
{String}Value
"connecting"
The state when DataChannel is attempting to establish a connection.
This is the initial state when a DataChannel connection is created. -
OPEN
{String}Value
"open"
The state when DataChannel connection is established.
This happens usually afterCONNECTING
state, or not when DataChannel connection is from initializing Peer (the one who begins the DataChannel connection). -
CLOSING
{String}Value
"closing"
The state when DataChannel connection is closing.
This happens when DataChannel connection is closing and happens afterOPEN
. -
CLOSED
{String}Value
"closed"
The state when DataChannel connection is closed.
This happens when DataChannel connection has closed and happens afterCLOSING
(or sometimesOPEN
depending on the browser implementation). -
ERROR
{String}Value
"error"
The state when DataChannel connection have met with an exception.
This may happen during any state not afterCLOSED
.
DATA_CHANNEL_TYPE
Attribute Type: {JSON}
These are the types of DataChannel connection that Skylink provides.
- Different channels serves different functionalities.
Keys:
-
MESSAGING
{String}MAIN connection | Value
"messaging"
This DataChannel connection is used for P2P messaging only, as used in sendP2PMessage().
Unless if self connects with Peers connecting from the mobile SDK platform applications, this connection would be used for data transfers as used in sendBlobData() and and sendURLData(), which allows only one outgoing and incoming data transfer one at a time (no multi-transfer support).
This connection will always be kept alive until the Peer connection has ended. -
DATA
{String}Value
"data"
This DataChannel connection is used for a data transfer, as used in sendBlobData() and sendURLData().
If self connects with Peers with DataChannel connections of this type, it indicates that multi-transfer is supported.
This connection will be closed once the data transfer has completed or terminated.
DATA_TRANSFER_DATA_TYPE
Attribute Type: {JSON}
These are the list of available transfer encodings that would be used by Skylink during a data transfer.
- The currently supported data type is
BINARY_STRING
. - Support for data types
BLOB
andARRAY_BUFFER
is still in implementation.
Keys:
-
BINARY_STRING
{String}DEFAULT | Value
"binaryString"
The option to let Skylink encode data packets using binary converted strings when sending the data packets through the DataChannel connection during data transfers. -
ARRAY_BUFFER
{String}IN IMPLEMENTATION | Value
"arrayBuffer"
The option to let Skylink encode data packets using ArrayBuffers when sending the data packets through the DataChannel connection during data transfers. -
BLOB
{String}IN IMPLEMENTATION | Value
"blob"
The option to let Skylink encode data packets using Blobs when sending the data packets through the DataChannel connection during data transfers.
DATA_TRANSFER_STATE
Attribute Type: {JSON}
These are the list of data transfer states that Skylink would trigger.
Keys:
-
UPLOAD_REQUEST
{String}Value
"request"
The state when a data transfer request has been received from Peer. This happens after Peer starts a data transfer using sendBlobData() or sendURLData(). -
UPLOAD_STARTED
{String}Value
"uploadStarted"
The state when the data transfer will begin and start to upload the first data packets to receiving Peer.
This happens after receiving Peer accepts a data transfer using acceptDataTransfer(). -
DOWNLOAD_STARTED
{String}Value
"downloadStarted"
The state when the data transfer has begin and associated DataChannel connection is expected to receive the first data packet from sending Peer.
This happens after self accepts a data transfer using acceptDataTransfer() upon the triggered state ofUPLOAD_REQUEST
. -
REJECTED
{String}Value
"rejected"
The state when the data transfer has been rejected by receiving Peer and data transfer is terminated.
This happens after Peer rejects a data transfer using acceptDataTransfer(). -
UPLOADING
{String}Value
"uploading"
The state when the data transfer is still being transferred to receiving Peer.
This happens after stateUPLOAD_STARTED
. -
DOWNLOADING
{String}Value
"downloading"
The state when the data transfer is still being transferred from sending Peer.
This happens after stateDOWNLOAD_STARTED
. -
UPLOAD_COMPLETED
{String}Value
"uploadCompleted"
The state when the data transfer has been transferred to receiving Peer successfully.
This happens after stateUPLOADING
orUPLOAD_STARTED
, depending on how huge the data being transferred is. -
DOWNLOAD_COMPLETED
{String}Value
"downloadCompleted"
The state when the data transfer has been transferred from sending Peer successfully.
This happens after stateDOWNLOADING
orDOWNLOAD_STARTED
, depending on how huge the data being transferred is. -
CANCEL
{String}Value
"cancel"
The state when the data transfer has been terminated by Peer.
This happens after stateDOWNLOAD_STARTED
orUPLOAD_STARTED
. -
ERROR
{String}Value
"error"
The state when the data transfer has occurred an exception.
At this stage, the data transfer would usually be terminated and may lead to stateCANCEL
.
DATA_TRANSFER_TYPE
Attribute Type: {JSON}
These are the types of data transfers that indicates if transfer is an outgoing (uploading) or incoming (downloding) transfers.
Keys:
-
UPLOAD
{String}Value
"upload"
This data transfer is an outgoing (uploading) transfer.
Data is sent to the receiving Peer using the associated DataChannel connection. -
DOWNLOAD
{String}Value
"download"
The data transfer is an incoming (downloading) transfer.
Data is received from the sending Peer using the associated DataChannel connection.
DT_PROTOCOL_VERSION
Attribute Type: {String}
The current version of the internal Data Transfer (DT) Protocol that Skylink is using.
- This is not a feature for developers to use but rather for SDK developers to see the Protocol version used in this Skylink version.
- In some cases, this information may be used for reporting issues with Skylink.
- DT_PROTOCOL VERSION:
0.1.0
.
GET_PEERS_STATE
Attribute Type: {JSON}
These are the list of Peer list retrieval states that Skylink would trigger.
- This relates to and requires the Privileged Key feature where Peers using that Privileged alias Key becomes a privileged Peer with privileged functionalities.
Keys:
-
ENQUIRED
{String}Value
"enquired"
The state when the privileged Peer already enquired signaling for list of peers. -
RECEIVED
{String}Value
"received"
The state when the privileged Peer received list of peers from signaling.
HANDSHAKE_PROGRESS
Attribute Type: {JSON}
These are the list of Peer connection handshake states that Skylink would trigger.
- Do not be confused with PEER_CONNECTION_STATE. This is the Peer recognition connection that is established with the platform signaling protocol, and not the Peer connection signaling state itself.
- In this case, this happens before the PEER_CONNECTION_STATE
handshaking states. The
OFFER
andANSWER
relates to the PEER_CONNECTION_STATE states. - For example as explanation how these state works below, let's make self as the offerer and the connecting Peer as the answerer.
Keys:
-
ENTER
{String}Value
"enter"
The state when Peer have receivedENTER
from self, and Peer connection with self is initialised with self.
This state will occur for both self and Peer asENTER
message is sent to ping for Peers in the room.
At this state, Peer would sentWELCOME
to the peer to start the session description connection handshake.Self Peer 1. Sends ENTER
Sends ENTER
2. - Receives self ENTER
3. - Sends self WELCOME
-
WELCOME
{String}Value
"welcome"
The state when self have receivedWELCOME
from Peer, and Peer connection is initialised with Peer.
At this state, self would start the session description connection handshake and send the localOFFER
session description to Peer.
REF: The will cause PEER_CONNECTION_STATE state go toSelf Peer 4. Receives WELCOME
- 5. Generates OFFER
- 6. Sets local OFFER
REF- 7. Sends OFFER
- HAVE_LOCAL_OFFER
. -
OFFER
{String}Value
"offer"
The state when Peer receivedOFFER
from self. At this state, Peer would set the remoteOFFER
session description and start to send localANSWER
session description to self.
REF: The will cause PEER_CONNECTION_STATE state go toSelf Peer 8. - Receives OFFER
9. - Sets remote OFFER
REF10. - Generates ANSWER
11. - Sets local ANSWER
12. - Sends ANSWER
HAVE_REMOTE_OFFER
. -
ANSWER
{String}Value
"answer"
The state when self receivedANSWER
from Peer.
At this state, self would set the remoteANSWER
session description and the connection handshaking progress has been completed.Self Peer 13. Receives ANSWER
- 14. Sets remote ANSWER
- -
ERROR
{String}Value
"error"
The state when connection handshake has occurred and exception, in this which the connection handshake could have been aborted abruptly and no Peer connection is established.
ICE_CONNECTION_STATE
Attribute Type: {JSON}
These are the list of Peer connection ICE connection states that Skylink would trigger.
- These states references the w3c WebRTC Specification Draft,
except the
TRICKLE_FAILED
state, which is an addition provided state by Skylink to inform that trickle ICE has failed.
Keys:
-
STARTING
{String}Value
"starting"
The state when the ICE agent is gathering addresses and/or waiting for remote candidates to be supplied.
This state occurs when Peer connection has just been initialised. -
CHECKING
{String}Value
"checking"
The state when 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.
This state occurs afterSTARTING
state. -
CONNECTED
{String}Value
"connected"
The state when 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.
This state occurs afterCHECKING
. -
COMPLETED
{String}Value
"completed"
The state when the ICE agent has finished gathering and checking and found a connection for all components.
This state occurs afterCONNECTED
(or sometimes afterCHECKING
). -
FAILED
{String}Value
"failed"
The state when the ICE agent is finished checking all candidate pairs and failed to find a connection for at least one component.
This state occurs during the ICE connection attempt afterSTARTING
state. -
DISCONNECTED
{String}Value
"disconnected"
The state when 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.
This state occurs afterCONNECTED
orCOMPLETED
state. -
CLOSED
{String}Value
"closed"
The state when the ICE agent has shut down and is no longer responding to STUN requests.
This state occurs after Peer connection has been disconnected (closed). -
TRICKLE_FAILED
{String}Value
"trickeFailed"
The state when attempting to connect successfully with ICE connection fails with trickle ICE connections.
Trickle ICE would be disabled after3
attempts to have a better successful ICE connection.
INTRODUCE_STATE
Attribute Type: {JSON}
These are the list of Peer introduction states that Skylink would trigger.
- This relates to and requires the Privileged Key feature where Peers using that Privileged alias Key becomes a privileged Peer with privileged functionalities.
Keys:
-
INTRODUCING
{String}Value
"enquired"
The state when the privileged Peer have sent the introduction signal. -
ERROR
{String}Value
"error"
The state when the Peer introduction has occurred an exception.
log
Attribute Type: {JSON}
The object that handles the logging functionality in Skylink.
Keys:
-
debug
{Function}See log.debug().
-
log
{Function}See log.log().
-
info
{Function}See log.info().
-
warn
{Function}See log.warn().
-
error
{Function}See log.error().
LOG_LEVEL
Attribute Type: {JSON}
These are the logging levels that Skylink provides.
- This manipulates the debugging messages sent to
console
object. - Refer to Javascript Web Console.
Keys:
-
DEBUG
{Number}Value
4
| Level higher thanLOG
Displays debugging logs fromLOG
level onwards withDEBUG
logs. -
LOG
{Number}Value
3
| Level higher thanINFO
Displays debugging logs fromINFO
level onwards withLOG
logs. -
INFO
{Number}Value
2
| Level higher thanWARN
Displays debugging logs fromWARN
level onwards withINFO
logs. -
WARN
{Number}Value
1
| Level higher thanERROR
Displays debugging logs ofERROR
level withWARN
logs. -
ERROR
{Number}DEFAULT | Value
0
| Lowest level Displays onlyERROR
logs.
PEER_CONNECTION_STATE
Attribute Type: {JSON}
These are the list of Peer connection signaling states that Skylink would trigger.
- Some of the state references the w3c WebRTC Specification Draft.
Keys:
-
STABLE
{String}Value
"stable"
The state when there is no handshaking in progress and when handshaking has just started or close.
This state occurs when Peer connection has just been initialised and afterHAVE_LOCAL_OFFER
orHAVE_REMOTE_OFFER
. -
HAVE_LOCAL_OFFER
{String}Value
"have-local-offer"
The state when the local session description"offer"
is generated and to be sent.
This state occurs afterSTABLE
state. -
HAVE_REMOTE_OFFER
{String}Value
"have-remote-offer"
The state when the remote session description"offer"
is received.
At this stage, this indicates that the Peer connection signaling handshaking has been completed, and likely would go back toSTABLE
after local"answer"
is received by Peer. -
CLOSED
{String}Value
"closed"
The state when the Peer connection is closed.
This state occurs when connection with Peer has been closed, usually when Peer leaves the room.
READY_STATE_CHANGE
Attribute Type: {JSON}
These are the list of room initialization ready states that Skylink would trigger.
- The states indicates if the required connection information has been retrieved successfully from the platform server to start a connection.
- These states are triggered when init() or Skylink/joinRoom:attr is invoked.
Keys:
-
INIT
{Number}Value
0
The state when Skylink is at the initial state before retrieval.
If all dependencies has been loaded, this would proceed toLOADING
state. -
LOADING
{Number}Value
1
The state when Skylink starts retrieving the connection information from the platform server.
This state occurs afterINIT
state and if retrieval is successful, this would proceed toCOMPLETED
state. -
COMPLETED
{Number}Value
2
The state when the connection information has been retrieved successfully.
This state occurs afterLOADING
, and if it's Skylink/joinRoom:attr that is invoked, room connection would commerce. -
ERROR
{Number}Value
-1
The state when an exception occured while retrieving the connection information.
This state might be triggered when dependencies failed to load or HTTP retrieval fails.
Reference READY_STATE_CHANGE_ERROR to see the list of errors that might have triggered theERROR
state.
READY_STATE_CHANGE_ERROR
Attribute Type: {JSON}
These are the list of room initialization ready state errors that Skylink has.
- Ready state errors like
ROOM_LOCKED
,API_NOT_ENOUGH_CREDIT
,API_NOT_ENOUGH_PREPAID_CREDIT
,API_FAILED_FINDING_PREPAID_CREDIT
andSCRIPT_ERROR
has been removed as they are no longer supported.
Keys:
-
API_INVALID
{Number}Value
4001
The error when provided Application Key does not exists (invalid).
For this error, it's recommended that you check if the Application Key exists in your account in the developer console. -
API_DOMAIN_NOT_MATCH
{Number}Value
4002
The error when application accessing from backend IP address is not valid for provided Application Key.
This rarely (and should not) occur and it's recommended to report this issue if this occurs. -
API_CORS_DOMAIN_NOT_MATCH
{Number}Value
4003
The error when application accessing from the CORS domain is not valid for provided Application Key.
For this error, it's recommended that you check the CORS configuration for the provided Application Key in the developer console. -
API_CREDENTIALS_INVALID
{Number}Value
4004
The error when credentials provided is not valid for provided Application Key.
For this error, it's recommended to check thecredentials
provided in init() configuration. -
API_CREDENTIALS_NOT_MATCH
{Number}Value
4005
The error when credentials does not match as expected generated credentials for provided Application Key.
For this error, it's recommended to check thecredentials
provided in init() configuration. -
API_INVALID_PARENT_KEY
{Number}Value
4006
The error when provided alias Application Key has an error because parent Application Key does not exists.
For this error, it's recommended to provide another alias Application Key. -
API_NO_MEETING_RECORD_FOUND
{Number}Value
4010
The error when there is no meeting currently that is open or available to join for self at the current time in the selected room.
For this error, it's recommended to retrieve the list of meetings and check if it exists using the Meeting Resource REST API. -
NO_SOCKET_IO
{Number}Value
1
The error when socket.io dependency is not loaded.
For this error, it's recommended to load the correct socket.io-client dependency from the CDN. -
NO_XMLHTTPREQUEST_SUPPORT
{Number}Value
2
The error when XMLHttpRequest is not supported in current browser.
For this error, it's recommended to ask user to switch to another browser that supportsXMLHttpRequest
. -
NO_WEBRTC_SUPPORT
{Number}Value
3
The error when WebRTC is not supported in current browser.
For this error, it's recommended to ask user to switch to another browser that supports WebRTC. -
NO_PATH
{Number}Value
4
The error when constructed path is invalid.
This rarely (and should not) occur and it's recommended to report this issue if this occurs. -
INVALID_XMLHTTPREQUEST_STATUS
{Number}Value
5
The error when XMLHttpRequest does not return a HTTP status code of200
but a HTTP failure.
This rarely (and should not) occur and it's recommended to report this issue if this occurs. -
ADAPTER_NO_LOADED
{Number}Value
7
The error when AdapterJS dependency is not loaded.
For this error, it's recommended to load the correct AdapterJS dependency from the CDN. -
XML_HTTP_REQUEST_ERROR
{Number}Value
-1
The error when XMLHttpRequest failure on the network level when attempting to connect to the platform server to retrieve selected room connection information.
This might happen when connection timeouts. If this is a persistent issue, it's recommended to report this issue.
REGIONAL_SERVER
Attribute Type: {JSON}
source/room-init.js:120
Available since 0.5.0
These are the list of available platform signaling servers Skylink should connect to for faster connectivity.
Keys:
-
APAC1
{String}Value
"sg"
The option to select the Asia pacific server 1 regional server. -
US1
{String}Value
"us2"
The option to select the US server 1 regional server.
SERVER_PEER_TYPE
Attribute Type: {JSON}
These are the types of server Peers that Skylink would connect with.
- Different server Peers that serves different functionalities.
- The server Peers functionalities are only available depending on the Application Key configuration.
- Eventually, this list will be populated as there are more server Peer functionalities provided by the Skylink platform.
Keys:
-
MCU
{String}Value
"mcu"
This server Peer is a MCU server connection.
SM_PROTOCOL_VERSION
Attribute Type: {String}
The current version of the internal Signaling Message (SM) Protocol that Skylink is using.
- This is not a feature for developers to use but rather for SDK developers to see the Protocol version used in this Skylink version.
- In some cases, this information may be used for reporting issues with Skylink.
- SM_PROTOCOL VERSION:
0.1.
.
SOCKET_ERROR
Attribute Type: {JSON}
These are the list of socket connection error states that Skylink would trigger.
- These error states references the socket.io-client events.
Keys:
-
CONNECTION_FAILED
{Number}Value
0
The error state when Skylink have failed to establish a socket connection with platform signaling in the first attempt. -
RECONNECTION_FAILED
{String}Value
-1
The error state when Skylink have failed to reestablish a socket connection with platform signaling after the first attemptCONNECTION_FAILED
. -
CONNECTION_ABORTED
{String}Value
-2
The error state when attempt to reestablish socket connection with platform signaling has been aborted after the failed first attemptCONNECTION_FAILED
. -
RECONNECTION_ABORTED
{String}Value
-3
The error state when attempt to reestablish socket connection with platform signaling has been aborted after several failed reattemptsRECONNECTION_FAILED
. -
RECONNECTION_ATTEMPT
{String}Value
-4
The error state when Skylink is attempting to reestablish a socket connection with platform signaling after a failed attemptCONNECTION_FAILED
orRECONNECTION_FAILED
.
SOCKET_FALLBACK
Attribute Type: {JSON}
These are the list of fallback attempt types that Skylink would attempt with.
Keys:
-
NON_FALLBACK
{String}Value
"nonfallback"
| Protocol"http:"
,"https:"
| Transports"WebSocket"
,"Polling"
The current socket connection attempt is using the first selected socket connection port for the current selected transport"Polling"
or"WebSocket"
. -
FALLBACK_PORT
{String}Value
"fallbackPortNonSSL"
| Protocol"http:"
| Transports"WebSocket"
The current socket connection reattempt is using the next selected socket connection port forHTTP
protocol connection with the current selected transport"Polling"
or"WebSocket"
. -
FALLBACK_PORT_SSL
{String}Value
"fallbackPortSSL"
| Protocol"https:"
| Transports"WebSocket"
The current socket connection reattempt is using the next selected socket connection port forHTTPS
protocol connection with the current selected transport"Polling"
or"WebSocket"
. -
LONG_POLLING
{String}Value
"fallbackLongPollingNonSSL"
| Protocol"http:"
| Transports"Polling"
The current socket connection reattempt is using the next selected socket connection port forHTTP
protocol connection with"Polling"
after many attempts of"WebSocket"
has failed. This occurs only for socket connection that is originally using"WebSocket"
transports. -
LONG_POLLING_SSL
{String}Value
"fallbackLongPollingSSL"
| Protocol"https:"
| Transports"Polling"
The current socket connection reattempt is using the next selected socket connection port forHTTPS
protocol connection with"Polling"
after many attempts of"WebSocket"
has failed. This occurs only for socket connection that is originally using"WebSocket"
transports.
SYSTEM_ACTION
Attribute Type: {JSON}
These are the list of platform signaling system actions that Skylink would be given with.
- Upon receiving from the signaling, the application has to reflect the relevant actions given.
- You may refer to SYSTEM_ACTION_REASON for the types of system action reasons that would be given.
Keys:
-
WARNING
{String}Value
"warning"
This action serves a warning to self. Usually if warning is not heeded, it may result in anREJECT
action. -
REJECT
{String}Value
"reject"
This action means that self has been kicked out of the current signaling room connection, and subsequent Peer connections would be disconnected.
SYSTEM_ACTION_REASON
Attribute Type: {JSON}
These are the list of Skylink platform signaling codes as the reason for the system action given by the platform signaling that Skylink would receive.
- You may refer to SYSTEM_ACTION for the types of system actions that would be given.
- Reason codes like
FAST_MESSAGE
,ROOM_FULL
,VERIFICATION
andOVER_SEAT_LIMIT
has been removed as they are no longer supported.
Keys:
-
ROOM_LOCKED
{String}Value
"locked"
| Action ties withREJECT
The reason code when room is locked and self is rejected from joining the room. -
DUPLICATED_LOGIN
{String}Value
"duplicatedLogin"
| Action ties withREJECT
The reason code when the credentials given is already in use, which the platform signaling throws an exception for this error.
This rarely occurs as Skylink handles this issue, and it's recommended to report this issue if this occurs. -
SERVER_ERROR
{String}Value
"serverError"
| Action ties withREJECT
The reason code when the connection with the platform signaling has an exception with self.
This rarely (and should not) occur and it's recommended to report this issue if this occurs. -
EXPIRED
{String}Value
"expired"
| Action ties withREJECT
The reason code when the persistent room meeting has expired so self is unable to join the room as the end time of the meeting has ended.
Depending on other meeting timings available for this room, the persistent room will appear expired.
This relates to the persistent room feature configured in the Application Key. -
ROOM_CLOSED
{String}Value
"roomclose"
| Action ties withREJECT
The reason code when the persistent room meeting has ended and has been rendered expired so self is rejected from the room as the meeting is over.
This relates to the persistent room feature configured in the Application Key. -
ROOM_CLOSING
{String}Value
"toclose"
| Action ties withWARNING
The reason code when the persistent room meeting is going to end soon, so this warning is given to inform users before self is rejected from the room.
This relates to the persistent room feature configured in the Application Key.
TURN_TRANSPORT
Attribute Type: {JSON}
These are the list of available transports that Skylink would use to connect to the TURN servers with.
- For example as explanation how these options works below, let's take that
these are list of TURN servers given by the platform signaling:
turn:turnurl:123?transport=tcp
turn:turnurl?transport=udp
turn:turnurl:1234
turn:turnurl
Keys:
-
TCP
{String}Value
"tcp"
The option to connect using only TCP transports. EXAMPLE OUTPUT
turn:turnurl:123?transport=tcp
turn:turnurl?transport=tcp
turn:turnurl:1234?transport=tcp
-
UDP
{String}Value
"udp"
The option to connect using only UDP transports. EXAMPLE OUTPUT
turn:turnurl:123?transport=udp
turn:turnurl?transport=udp
turn:turnurl:1234?transport=udp
-
ANY
{String}DEFAULT | Value
"any"
This option to use any transports that is preconfigured by provided by the platform signaling. EXAMPLE OUTPUT
turn:turnurl:123?transport=tcp
turn:turnurl?transport=udp
turn:turnurl:1234
turn:turnurl
-
NONE
{String}Value
"none"
This option to set no transports. EXAMPLE OUTPUT
turn:turnurl:123
turn:turnurl
turn:turnurl:1234
-
ALL
{String}Value
"all"
This option to use both TCP and UDP transports. EXAMPLE OUTPUT
turn:turnurl:123?transport=tcp
turn:turnurl:123?transport=udp
turn:turnurl?transport=tcp
turn:turnurl?transport=udp
turn:turnurl:1234?transport=tcp
turn:turnurl:1234?transport=udp
VIDEO_CODEC
Attribute Type: {JSON}
These are the list of available video codecs settings that Skylink would use when streaming video stream with Peers.
- The video codec would be used if the self and Peer's browser supports the selected codec.
- This would default to the browser selected codec. In most cases, option
VP8
is used by default.
Keys:
-
AUTO
{String}DEFAULT | Value
"auto"
The option to let Skylink use any video codec selected by the browser generated session description. -
VP8
{String}Value
"VP8"
The option to let Skylink use the VP8 codec.
This is the common and mandantory video codec used by most browsers. -
H264
{String}Value
"H264"
The option to let Skylink use the H264 codec.
This only works if the browser supports the H264 video codec.
VIDEO_RESOLUTION
Attribute Type: {JSON}
These are the list of suggested video resolutions that Skylink should configure when retrieving self user media video stream.
- Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution.
- It's recommended to use video resolution option to maximum
FHD
, as the other resolution options may be unrealistic and create performance issues. However, we provide them to allow developers to test with the browser capability, but do use it at your own risk. - The higher the resolution, the more CPU usage might be used, hence it's recommended to
use the default option
VGA
. - This follows the Wikipedia Graphics display resolution page
Keys:
-
QQVGA
{JSON}Value
{ width: 160, height: 120 }
| Aspect Ratio4:3
The option to use QQVGA resolution. -
HQVGA
{JSON}Value
{ width: 240, height: 160 }
| Aspect Ratio3:2
The option to use HQVGA resolution. -
QVGA
{JSON}Value
{ width: 320, height: 240 }
| Aspect Ratio4:3
The option to use QVGA resolution. -
WQVGA
{JSON}Value
{ width: 384, height: 240 }
| Aspect Ratio16:10
The option to use WQVGA resolution. -
HVGA
{JSON}Value
{ width: 480, height: 320 }
| Aspect Ratio3:2
The option to use HVGA resolution. -
VGA
{JSON}DEFAULT | Value
{ width: 640, height: 480 }
| Aspect Ratio4:3
The option to use VGA resolution. -
WVGA
{JSON}Value
{ width: 768, height: 480 }
| Aspect Ratio16:10
The option to use WVGA resolution. -
FWVGA
{JSON}Value
{ width: 854, height: 480 }
| Aspect Ratio16:9
The option to use FWVGA resolution. -
SVGA
{JSON}Value
{ width: 800, height: 600 }
| Aspect Ratio4:3
The option to use SVGA resolution. -
DVGA
{JSON}Value
{ width: 960, height: 640 }
| Aspect Ratio3:2
The option to use DVGA resolution. -
WSVGA
{JSON}Value
{ width: 1024, height: 576 }
| Aspect Ratio16:9
The option to use WSVGA resolution. -
HD
{JSON}Value
{ width: 1280, height: 720 }
| Aspect Ratio16:9
The option to use HD resolution. -
HDPLUS
{JSON}Value
{ width: 1600, height: 900 }
| Aspect Ratio16:9
The option to use HDPLUS resolution. -
FHD
{JSON}Value
{ width: 1920, height: 1080 }
| Aspect Ratio16:9
The option to use FHD resolution. -
QHD
{JSON}Value
{ width: 2560, height: 1440 }
| Aspect Ratio16:9
The option to use QHD resolution. -
WQXGAPLUS
{JSON}Value
{ width: 3200, height: 1800 }
| Aspect Ratio16:9
The option to use WQXGAPLUS resolution. -
UHD
{JSON}Value
{ width: 3840, height: 2160 }
| Aspect Ratio16:9
The option to use UHD resolution. -
UHDPLUS
{JSON}Value
{ width: 5120, height: 2880 }
| Aspect Ratio16:9
The option to use UHDPLUS resolution. -
FUHD
{JSON}Value
{ width: 7680, height: 4320 }
| Aspect Ratio16:9
The option to use FUHD resolution. -
QUHD
{JSON}Value
{ width: 15360, height: 8640 }
| Aspect Ratio16:9
The option to use QUHD resolution.
candidateGenerationState
Event triggered when a Peer connection ICE gathering state has changed.
- This event is a debugging feature, and it's used to check the Peer ICE candidate gathering status.
- This indicates if the ICE gathering has been completed to start ICE connection for DataChannel and media streaming connection.
Event Payload:
-
state
{String}The current ICE gathering state. See the list of available triggered states in the related link. [Rel: Skylink.CANDIDATE_GENERATION_STATE]
-
peerId
{String}The Peer ID associated with the connection
channelClose
Event triggered when the socket connection to the platform signaling is closed.
- This event means that socket connection is closed and self has left the room.
channelError
Event triggered when the socket connection has occurred an exception during a connection with the platform signaling.
- After this event is triggered, it may result in channelClose, and the socket connection with the platform signaling could be disrupted.
Event Payload:
-
error
{Object | String}The error object thrown that caused the exception.
channelMessage
Event triggered when the socket connection is exchanging messages with the platform signaling.
- This event is a debugging feature, and it's not advisable to subscribe to this event unless you are debugging the socket messages received from the platform signaling.
Event Payload:
-
message
{JSON}The socket message object data received from the platform signaling.
channelOpen
Event triggered when the socket connection to the platform signaling is opened.
- This event means that socket connection is open and self is ready to join the room.
channelRetry
Event triggered when attempting to reconnect the socket connection with the platform signaling.
- Depending on the current
type
triggered in socketError event before, it may or may not attempt the socket reconnection and this event may not be triggered. - If reconnection attempt fails, it will trigger socketError event again and repeat the stage from there.
Event Payload:
-
fallbackType
{String}The fallback socket transport that Skylink is attempting to reconnect with. [Rel: Skylink.SOCKET_FALLBACK]
-
currentAttempt
{Number}The current reconnection attempt.
dataChannelState
Event triggered when a Peer connection DataChannel connection state has changed.
- This event is a debugging feature, and it's used to check the Peer DataChannel connection, which is used for P2P messaging and transfers for methods like sendBlobData(), sendURLData() and sendP2PMessage().
- If
enableDataChannel
disabled in init() configuration settings, this event will not be triggered at all.
Event Payload:
-
state
{String}The current DataChannel connection state. [Rel: Skylink.DATA_CHANNEL_STATE]
-
peerId
{String}The Peer ID associated with the current DataChannel connection state.
-
error
{Object} OptionalThe error object thrown when there is a failure in the DataChannel connection. If received as
null
, it means that there is no errors. -
channelName
{String}The DataChannel connection ID.
-
channelType
{String}The DataChannel connection functionality type. [Rel: Skylink.DATA_CHANNEL_TYPE]
dataTransferState
Event triggered when a data transfer state has changed.
- This event triggers more extensive states like the outgoing and incoming data transfer progress and rejection of data transfer requests. For simplified events, you may subscribe to the incomingDataRequest and incomingData events.
- If
enableDataChannel
disabled in init() configuration settings, this event will not be triggered at all.
Event Payload:
-
state
{String}The data transfer made to Peer in a DataChannel connection state. [Rel: Skylink.DATA_TRANSFER_STATE]
-
transferId
{String}The transfer ID of the completed data transfer.
-
peerId
{String}The Peer ID associated with the data transfer.
-
transferInfo
{JSON}The transfer data object information.
-
data
{Blob | String}The transfer data object. This is defined only after the transfer data is completed, when the state is
DATA_TRANSFER_STATE.DOWNLOAD_COMPLETED
andDATA_TRANSFER_STATE.UPLOAD_STARTED
For Blob data object, see the createObjectURL method on how you can convert the Blob data object to a download link. -
name
{String} OptionalThe transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.
-
size
{Number}The transfer data size.
-
dataType
{String}The type of data transfer initiated. Available types are
"dataURL"
and"blob"
. -
timeout
{String}The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
-
isPrivate
{Boolean}The flag to indicate if the data transferred targeted Peer peers and not broadcasted to all Peer peers.
-
-
error
{JSON} OptionalThe error object thrown when there is a failure in transferring data.
-
message
{Object}The exception thrown that caused the failure for transferring data.
-
transferType
{String}The data transfer type to indicate if the DataChannel is uploading or downloading the data transfer when the exception occurred. [Rel: Skylink.DATA_TRANSFER_TYPE]
-
getPeersStateChange
Event triggered when the retrieval of the list of rooms and peers under the same realm based on the Application Key configured in init() from the platform signaling state has changed.
- This requires that the provided alias Application Key has privileged feature configured.
Event Payload:
-
state
{String}The retrieval current status.
-
privilegedPeerId
{String}The Peer ID of the privileged Peer.
-
peerList
{JSON}The retrieved list of rooms and peers under the same realm based on the Application Key configured in
init()
.
handshakeProgress
Event triggered when a Peer handshaking state has changed.
- This event may trigger
state
HANDSHAKE_PROGRESS.ENTER
for self to indicate that broadcast to ping for any existing Peers in the room has been made. - This event is a debugging feature, and it's used to check the Peer handshaking connection status.
- This starts the Peer connection handshaking, where it retrieves all the Peer information and then proceeds to start the ICE connection.
Event Payload:
-
state
{String}The Peer connection handshake state. [Rel: Skylink.HANDSHAKE_PROGRESS]
-
peerId
{String}The Peer ID associated with the connection handshake state.
-
error
{Object | String} OptionalThe error object thrown when there is a failure in the connection handshaking.
iceConnectionState
Event triggered when a Peer connection ICE connection state has changed.
- This event is a debugging feature, and it's used to check the Peer ICE connection of added ICE candidates status.
- This event indicates if the ICE connection is established for successful DataChannel and media streaming connection.
Event Payload:
-
state
{String}The current ICE connection state. [Rel: Skylink.ICE_CONNECTION_STATE]
-
peerId
{String}The Peer ID associated with the current ICE connection state.
incomingData
Event triggered when a data transfer is completed.
- This event may trigger for self when transferring data to Peer, which indicates that self has transferred the data successfully.
- For more extensive states like the outgoing and incoming data transfer progress and rejection of data transfer requests, you may subscribe to the dataTransferState event.
- If
enableDataChannel
disabled in init() configuration settings, this event will not be triggered at all.
Event Payload:
-
data
{Blob | String}The transferred data object.
For Blob data object, see the createObjectURL method on how you can convert the Blob data object to a download link. -
transferId
{String}The transfer ID of the completed data transfer.
-
peerId
{String}The Peer ID associated with the data transfer.
-
transferInfo
{JSON}The transfer data object information.
-
name
{String} OptionalThe transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.
-
size
{Number}The transfer data size.
-
dataType
{String}The type of data transfer initiated. Available types are
"dataURL"
and"blob"
. -
timeout
{String}The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
-
isPrivate
{Boolean}The flag to indicate if the data transferred targeted Peer peers and not broadcasted to all Peer peers.
-
-
isSelf
{Boolean}The flag that indicates if the data transfer is from self or from associated Peer.
incomingDataRequest
Event triggered when there is a request to start a data transfer.
- This event may trigger for self when requesting a data transfer to Peer, which indicates that self has sent the data transfer request.
- For more extensive states like the outgoing and incoming data transfer progress and rejection of data transfer requests, you may subscribe to the dataTransferState event.
- If
enableDataChannel
disabled in init() configuration settings, this event will not be triggered at all. - DATA TRANSFER STAGE
dataTransferState → incomingDataRequest → incomingData
Event Payload:
-
transferId
{String}The transfer ID of the data transfer request.
-
peerId
{String}The Peer ID associated with the data transfer request.
-
transferInfo
{JSON}The transfer data object information.
-
name
{String} OptionalThe transfer data object name. If there is no name based on the Blob given, the name would be the transfer ID.
-
size
{Number}The transfer data size.
-
dataType
{String}The type of data transfer initiated. Available types are
"dataURL"
and"blob"
. -
timeout
{String}The waiting timeout in seconds that the DataChannel connection data transfer should wait before throwing an exception and terminating the data transfer.
-
isPrivate
{Boolean}The flag to indicate if the data transferred targeted Peer peers and not broadcasted to all Peer peers.
-
-
isSelf
{Boolean}The flag that indicates if the data transfer request is from self or from associated Peer.
incomingMessage
Event triggered when message data is received from Peer.
- This event may trigger for self when sending message data to Peer, which indicates that self has sent the message data.
Event Payload:
-
message
{JSON}The message object received from Peer.
-
content
{JSON | String}The message object content. This is the message data content passed in sendMessage() and sendP2PMessage().
-
senderPeerId
{String}The Peer ID of the peer who sent the message object.
-
targetPeerId
{String | Array} OptionalThe array of targeted Peer peers or the single targeted Peer the message is targeted to received the message object. If the value is
null
, the message object is broadcasted to all Peer peers in the room. -
isPrivate
{Boolean}The flag that indicates if the message object is sent to targeted Peer peers and not broadcasted to all Peer peers.
-
isDataChannel
{Boolean}The flag that indicates if the message object is sent from the platform signaling socket connection or P2P channel connection (DataChannel connection).
-
-
peerId
{String}The Peer ID of peer who sent the message object.
-
peerInfo
{Object}The peer information associated with the Peer Connection.
-
userData
{String | JSON}The custom user data information set by developer. This custom user data can also be set in setUserData().
-
settings
{JSON}The Peer Stream streaming settings information. If both audio and video option is
false
, there should be no receiving remote Stream object from this associated Peer.-
audio
{Boolean | JSON} OptionalThe Peer Stream streaming audio settings. Iffalse
, it means that audio streaming is disabled in the remote Stream of the Peer. -
audio.stereo
{Boolean} OptionalThe flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check theaudioCodec
configuration settings in init() to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming. -
video
{Boolean | JSON} OptionalThe Peer Stream streaming video settings. Iffalse
, it means that video streaming is disabled in the remote Stream of the Peer. -
video.resolution
{JSON} OptionalThe Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Number} OptionalThe Peer Stream streaming video resolution width. -
video.resolution.height
{Number} OptionalThe Peer Stream streaming video resolution height. -
video.frameRate
{Number} OptionalThe Peer Stream streaming video maximum frameRate. -
video.screenshare
{Boolean} OptionalThe flag that indicates if the Peer connection Stream object sent is a screensharing stream or not. -
bandwidth
{String} OptionalThe Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s. -
bandwidth.audio
{String} OptionalThe configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s. -
bandwidth.video
{String} OptionalThe configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s. -
bandwidth.data
{String} OptionalThe configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
-
-
mediaStatus
{JSON}The Peer Stream mute settings for both audio and video streamings.
-
audioMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set totrue
. -
videoMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set totrue
.
-
-
agent
{JSON}The Peer platform agent information.
-
name
{String}The Peer platform browser or agent name. -
version
{Number}The Peer platform browser or agent version. -
os
{Number}The Peer platform name.
-
-
room
{String}The current room that the Peer is in.
-
-
isSelf
{Boolean}The flag that indicates if self is the Peer.
incomingStream
Event triggered when a Stream is sent by Peer.
- This event may trigger for self, which indicates that self has joined the room and is sending this Stream object to other Peers connected in the room.
Event Payload:
-
peerId
{String}The Peer ID associated to the Stream object.
-
stream
{Object}The Peer MediaStream object that is sent in this connection. To display the MediaStream object to a
video
oraudio
, simply invoke:
attachMediaStream(domElement, stream);
. -
peerInfo
{Object}The peer information associated with the Peer Connection.
-
userData
{String | JSON}The custom user data information set by developer. This custom user data can also be set in setUserData().
-
settings
{JSON}The Peer Stream streaming settings information. If both audio and video option is
false
, there should be no receiving remote Stream object from this associated Peer.-
audio
{Boolean | JSON} OptionalThe Peer Stream streaming audio settings. Iffalse
, it means that audio streaming is disabled in the remote Stream of the Peer. -
audio.stereo
{Boolean} OptionalThe flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check theaudioCodec
configuration settings in init() to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming. -
video
{Boolean | JSON} OptionalThe Peer Stream streaming video settings. Iffalse
, it means that video streaming is disabled in the remote Stream of the Peer. -
video.resolution
{JSON} OptionalThe Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Number} OptionalThe Peer Stream streaming video resolution width. -
video.resolution.height
{Number} OptionalThe Peer Stream streaming video resolution height. -
video.frameRate
{Number} OptionalThe Peer Stream streaming video maximum frameRate. -
video.screenshare
{Boolean} OptionalThe flag that indicates if the Peer connection Stream object sent is a screensharing stream or not. -
bandwidth
{String} OptionalThe Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s. -
bandwidth.audio
{String} OptionalThe configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s. -
bandwidth.video
{String} OptionalThe configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s. -
bandwidth.data
{String} OptionalThe configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
-
-
mediaStatus
{JSON}The Peer Stream mute settings for both audio and video streamings.
-
audioMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set totrue
. -
videoMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set totrue
.
-
-
agent
{JSON}The Peer platform agent information.
-
name
{String}The Peer platform browser or agent name. -
version
{Number}The Peer platform browser or agent version. -
os
{Number}The Peer platform name.
-
-
room
{String}The current room that the Peer is in.
-
-
isSelf
{Boolean}The flag that indicates if self is the Peer.
introduceStateChange
Event triggered when introductory state of two Peer peers to each other selected by the privileged Peer state has changed.
- This requires that the provided alias Application Key has privileged feature configured.
Event Payload:
-
state
{String}The Peer introduction state.
-
privilegedPeerId
{String}The Peer ID of the privileged Peer.
-
sendingPeerId
{String}The Peer ID of the peer that initiates the connection with the introduced Peer.
-
receivingPeerId
{String}The Peer ID of the introduced peer who would be introduced to the initiator Peer.
-
reason
{String}The error object thrown when there is a failure in the introduction with the two Peer peers. If received as
null
, it means that there is no errors.
mediaAccessError
Event triggered when access to self user media stream has failed.
- If
audioFallback
is enabled in init(), it will throw an error if audio only user media stream failed after a failed attempt to retrieve video and audio user media.
Event Payload:
-
error
{Object | String}The error object thrown that caused the failure.
-
isScreensharing
{Boolean}The flag that indicates if self Stream object is a screensharing stream or not.
-
isAudioFallbackError
{Boolean}The flag that indicates if Skylink throws the error after an audio fallback has been attempted.
mediaAccessFallback
Event triggered when attempt to fallback to retrieve audio only user media stream has been made.
- If
audioFallback
is enabled in init(), and if there is a failed attempt to retrieve video and audio user media, it will attempt to do the audio fallback.
Event Payload:
-
error
{Object | String}The error object thrown that caused the failure from retrieve video and audio user media stream.
mediaAccessRequired
Event triggered when the application requires to retrieve self user media stream manually instead of doing it automatically in joinRoom().
- This event triggers based on the configuration of
manualGetUserMedia
in the joinRoom() configuration settings. - Developers must manually invoke getUserMedia() to retrieve the user media stream before self would join the room. Once the user media stream is attached, self would proceed to join the room automatically.
mediaAccessStopped
Event triggered when self user media stream attached to Skylink has been stopped.
Event Payload:
-
isScreensharing
{Boolean}The flag that indicates if self Stream object is a screensharing stream or not.
mediaAccessSuccess
Event triggered when access to self user media stream is successfully attached to Skylink.
Event Payload:
-
stream
{Object}The self user MediaStream object. To display the MediaStream object to a
video
oraudio
, simply invoke:
attachMediaStream(domElement, stream);
. -
isScreensharing
{Boolean}The flag that indicates if self Stream object is a screensharing stream or not.
peerConnectionState
Event triggered when a Peer connection signaling state has changed.
- This event is a debugging feature, and it's used to check the Peer signaling connection status.
- This event indicates if the session description is received to start ICE gathering for DataChannel and media streaming connection.
Event Payload:
-
state
{String}The current connection signaling state. [Rel: Skylink.PEER_CONNECTION_STATE]
-
peerId
{String}The Peer ID associated with the current connection signaling state.
peerJoined
Event triggered when a Peer joins the room.
Event Payload:
-
peerId
{String}The Peer ID of the new peer that has joined the room.
-
peerInfo
{Object}The peer information associated with the Peer Connection.
-
userData
{String | JSON}The custom user data information set by developer. This custom user data can also be set in setUserData().
-
settings
{JSON}The Peer Stream streaming settings information. If both audio and video option is
false
, there should be no receiving remote Stream object from this associated Peer.-
audio
{Boolean | JSON} OptionalThe Peer Stream streaming audio settings. Iffalse
, it means that audio streaming is disabled in the remote Stream of the Peer. -
audio.stereo
{Boolean} OptionalThe flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check theaudioCodec
configuration settings in init() to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming. -
video
{Boolean | JSON} OptionalThe Peer Stream streaming video settings. Iffalse
, it means that video streaming is disabled in the remote Stream of the Peer. -
video.resolution
{JSON} OptionalThe Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Number} OptionalThe Peer Stream streaming video resolution width. -
video.resolution.height
{Number} OptionalThe Peer Stream streaming video resolution height. -
video.frameRate
{Number} OptionalThe Peer Stream streaming video maximum frameRate. -
video.screenshare
{Boolean} OptionalThe flag that indicates if the Peer connection Stream object sent is a screensharing stream or not. -
bandwidth
{String} OptionalThe Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s. -
bandwidth.audio
{String} OptionalThe configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s. -
bandwidth.video
{String} OptionalThe configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s. -
bandwidth.data
{String} OptionalThe configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
-
-
mediaStatus
{JSON}The Peer Stream mute settings for both audio and video streamings.
-
audioMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set totrue
. -
videoMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set totrue
.
-
-
agent
{JSON}The Peer platform agent information.
-
name
{String}The Peer platform browser or agent name. -
version
{Number}The Peer platform browser or agent version. -
os
{Number}The Peer platform name.
-
-
room
{String}The current room that the Peer is in.
-
-
isSelf
{Boolean}The flag that indicates if self is the Peer.
peerLeft
Event triggered when a Peer leaves the room.
Event Payload:
-
peerId
{String}The Peer ID of the peer that had left the room.
-
peerInfo
{Object}The peer information associated with the Peer Connection.
-
userData
{String | JSON}The custom user data information set by developer. This custom user data can also be set in setUserData().
-
settings
{JSON}The Peer Stream streaming settings information. If both audio and video option is
false
, there should be no receiving remote Stream object from this associated Peer.-
audio
{Boolean | JSON} OptionalThe Peer Stream streaming audio settings. Iffalse
, it means that audio streaming is disabled in the remote Stream of the Peer. -
audio.stereo
{Boolean} OptionalThe flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check theaudioCodec
configuration settings in init() to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming. -
video
{Boolean | JSON} OptionalThe Peer Stream streaming video settings. Iffalse
, it means that video streaming is disabled in the remote Stream of the Peer. -
video.resolution
{JSON} OptionalThe Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Number} OptionalThe Peer Stream streaming video resolution width. -
video.resolution.height
{Number} OptionalThe Peer Stream streaming video resolution height. -
video.frameRate
{Number} OptionalThe Peer Stream streaming video maximum frameRate. -
video.screenshare
{Boolean} OptionalThe flag that indicates if the Peer connection Stream object sent is a screensharing stream or not. -
bandwidth
{String} OptionalThe Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s. -
bandwidth.audio
{String} OptionalThe configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s. -
bandwidth.video
{String} OptionalThe configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s. -
bandwidth.data
{String} OptionalThe configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
-
-
mediaStatus
{JSON}The Peer Stream mute settings for both audio and video streamings.
-
audioMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set totrue
. -
videoMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set totrue
.
-
-
agent
{JSON}The Peer platform agent information.
-
name
{String}The Peer platform browser or agent name. -
version
{Number}The Peer platform browser or agent version. -
os
{Number}The Peer platform name.
-
-
room
{String}The current room that the Peer is in.
-
-
isSelf
{Boolean}The flag that indicates if self is the Peer.
peerRestart
Event triggered when a Peer connection has been restarted for a reconnection.
Event Payload:
-
peerId
{String}The Peer ID of the connection that is restarted for a reconnection.
-
peerInfo
{Object}The peer information associated with the Peer Connection.
-
userData
{String | JSON}The custom user data information set by developer. This custom user data can also be set in setUserData().
-
settings
{JSON}The Peer Stream streaming settings information. If both audio and video option is
false
, there should be no receiving remote Stream object from this associated Peer.-
audio
{Boolean | JSON} OptionalThe Peer Stream streaming audio settings. Iffalse
, it means that audio streaming is disabled in the remote Stream of the Peer. -
audio.stereo
{Boolean} OptionalThe flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check theaudioCodec
configuration settings in init() to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming. -
video
{Boolean | JSON} OptionalThe Peer Stream streaming video settings. Iffalse
, it means that video streaming is disabled in the remote Stream of the Peer. -
video.resolution
{JSON} OptionalThe Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Number} OptionalThe Peer Stream streaming video resolution width. -
video.resolution.height
{Number} OptionalThe Peer Stream streaming video resolution height. -
video.frameRate
{Number} OptionalThe Peer Stream streaming video maximum frameRate. -
video.screenshare
{Boolean} OptionalThe flag that indicates if the Peer connection Stream object sent is a screensharing stream or not. -
bandwidth
{String} OptionalThe Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s. -
bandwidth.audio
{String} OptionalThe configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s. -
bandwidth.video
{String} OptionalThe configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s. -
bandwidth.data
{String} OptionalThe configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
-
-
mediaStatus
{JSON}The Peer Stream mute settings for both audio and video streamings.
-
audioMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set totrue
. -
videoMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set totrue
.
-
-
agent
{JSON}The Peer platform agent information.
-
name
{String}The Peer platform browser or agent name. -
version
{Number}The Peer platform browser or agent version. -
os
{Number}The Peer platform name.
-
-
room
{String}The current room that the Peer is in.
-
-
isSelfInitiateRestart
{Boolean}The flag that indicates if self is the one who have initiated the Peer connection restart.
peerUpdated
Event triggered when a Peer information have been updated.
- This event would only be triggered if self is in the room.
- This event triggers when the
peerInfo
data is updated, likepeerInfo.mediaStatus
or thepeerInfo.userData
, which is invoked through muteStream() or setUserData().
Event Payload:
-
peerId
{String}The Peer ID of the peer with updated information.
-
peerInfo
{Object}The peer information associated with the Peer Connection.
-
userData
{String | JSON}The custom user data information set by developer. This custom user data can also be set in setUserData().
-
settings
{JSON}The Peer Stream streaming settings information. If both audio and video option is
false
, there should be no receiving remote Stream object from this associated Peer.-
audio
{Boolean | JSON} OptionalThe Peer Stream streaming audio settings. Iffalse
, it means that audio streaming is disabled in the remote Stream of the Peer. -
audio.stereo
{Boolean} OptionalThe flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check theaudioCodec
configuration settings in init() to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming. -
video
{Boolean | JSON} OptionalThe Peer Stream streaming video settings. Iffalse
, it means that video streaming is disabled in the remote Stream of the Peer. -
video.resolution
{JSON} OptionalThe Peer Stream streaming video resolution settings. Setting the resolution may not force set the resolution provided as it depends on the how the browser handles the resolution. [Rel: Skylink.VIDEO_RESOLUTION] -
video.resolution.width
{Number} OptionalThe Peer Stream streaming video resolution width. -
video.resolution.height
{Number} OptionalThe Peer Stream streaming video resolution height. -
video.frameRate
{Number} OptionalThe Peer Stream streaming video maximum frameRate. -
video.screenshare
{Boolean} OptionalThe flag that indicates if the Peer connection Stream object sent is a screensharing stream or not. -
bandwidth
{String} OptionalThe Peer streaming bandwidth settings. Setting the bandwidth flags may not force set the bandwidth for each connection stream channels as it depends on how the browser handles the bandwidth bitrate. Values are configured in kb/s. -
bandwidth.audio
{String} OptionalThe configured audio stream channel for the remote Stream object bandwidth that audio streaming should use in kb/s. -
bandwidth.video
{String} OptionalThe configured video stream channel for the remote Stream object bandwidth that video streaming should use in kb/s. -
bandwidth.data
{String} OptionalThe configured datachannel channel for the DataChannel connection bandwidth that datachannel connection per packet should be able use in kb/s.
-
-
mediaStatus
{JSON}The Peer Stream mute settings for both audio and video streamings.
-
audioMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object audio streaming is muted. If there is no audio streaming enabled for the Peer, by default, it is set totrue
. -
videoMuted
{Boolean} OptionalThe flag that indicates if the remote Stream object video streaming is muted. If there is no video streaming enabled for the Peer, by default, it is set totrue
.
-
-
agent
{JSON}The Peer platform agent information.
-
name
{String}The Peer platform browser or agent name. -
version
{Number}The Peer platform browser or agent version. -
os
{Number}The Peer platform name.
-
-
room
{String}The current room that the Peer is in.
-
-
isSelf
{Boolean}The flag that indicates if self is the Peer.
readyStateChange
Event triggered when room connection information is being retrieved from platform server.
- This is also triggered when init() is invoked, but the socket connection events like channelOpen does not get triggered but stops at readyStateChange event.
Event Payload:
-
readyState
{String}The current ready state of the retrieval when the event is triggered. [Rel: Skylink.READY_STATE_CHANGE]
-
error
{JSON} OptionalThe error object thrown when there is a failure in retrieval. If received as
null
, it means that there is no errors.-
status
{Number}Http status when retrieving information. May be empty for other errors.
-
errorCode
{Number}The READY_STATE_CHANGE_ERROR if there is an readyStateChange event error that caused the failure for initialising Skylink. [Rel: Skylink.READY_STATE_CHANGE_ERROR]
-
content
{Object}The exception thrown that caused the failure for initialising Skylink.
-
status
{Number}The XMLHttpRequest status code received when exception is thrown that caused the failure for initialising Skylink.
-
-
room
{String}The selected room connection information that Skylink is attempting to retrieve the information for to start connection to.
roomLock
Event triggered when the currently connected room lock status have been updated.
- If this event is triggered, this means that the room is locked / unlocked which may allow or prevent any other Peers from joining the room.
Event Payload:
-
isLocked
{Boolean}The flag that indicates if the currently connected room is locked.
-
peerId
{String}The Peer ID of the peer that updated the currently connected room lock status.
-
peerInfo
{Object}The peer information associated with the Peer Connection.
-
userData
{String | JSON}The custom user data information set by developer. This custom user data can also be set in setUserData().
-
settings
{JSON}The Peer Stream streaming settings information. If both audio and video option is
false
, there should be no receiving remote Stream object from this associated Peer.-
audio
{Boolean | JSON} OptionalThe Peer Stream streaming audio settings. Iffalse
, it means that audio streaming is disabled in the remote Stream of the Peer. -
audio.stereo
{Boolean} OptionalThe flag that indicates if stereo option should be explictly enabled to an OPUS enabled audio stream. Check theaudioCodec
configuration settings in init() to enable OPUS as the audio codec. Note that stereo is already enabled for OPUS codecs, this only adds a stereo flag to the SDP to explictly enable stereo in the audio streaming. -
video
{Boolean | JSON} OptionalThe Peer Stream streaming video settings. Iffalse