// Example 2: Upload data to a list of Peers function uploadFileAll (file) { var cb = function (error, success) { var listOfPeers = error ? error.listOfPeers : success.listOfPeers; var listOfPeersErrors = error ? error.transferErrors : {}; for (var i = 0; i < listOfPeers.length; i++) { if (listOfPeersErrors[listOfPeers[i]]) { console.error("Failed file transfer to '" + listOfPeers[i] + "'"); } else { console.info("File has been transferred to '" + listOfPeers[i] + "' successfully"); } } }; if (transferTimeout > 0) { skylinkDemo.sendBlobData(file, transferTimeout, cb); } else { skylinkDemo.sendBlobData(file, cb); } } </script> </body>
Events Sequence:
- Checks if User is in Room.
- If User is not in Room:
-
dataTransferState
event triggers parameter payloadstate
asSTART_ERROR
. - ABORT step and return error.
-
- If User is not in Room:
- Checks if there is any available Datachannel connections.
- If User is not in Room:
-
dataTransferState
event triggers parameter payloadstate
asSTART_ERROR
. - ABORT step and return error.
-
- If User is not in Room:
- Checks if provided
data
parameter is valid.- If it is invalid:
-
dataTransferState
event triggers parameter payloadstate
asSTART_ERROR
. - ABORT step and return error.
-
- If it is invalid:
- Checks if Peer connection and Datachannel connection are in correct states.
- If Peer connection or session does not exists:
-
dataTransferState
event triggers parameter payloadstate
asERROR
. - ABORT step and return error.
-
- If Peer connection is not stable: The stable state can be checked with
peerConnectionState
event triggering parameter payloadstate
asSTABLE
for Peer.dataTransferState
event triggers parameter payloadstate
asERROR
.- ABORT step and return error.
- If Peer connection messaging Datachannel has not been opened: This can be checked with
dataChannelState
event triggering parameter payloadstate
asOPEN
andchannelType
asMESSAGING
for Peer.-
dataTransferState
event triggers parameter payloadstate
asERROR
. - ABORT step and return error.
-
- If MCU is enabled for the App Key provided in
init()
method and connected:- If MCU Peer connection is not stable: The stable state can be checked with
peerConnectionState
event triggering parameter payloadstate
asSTABLE
andpeerId
value as"MCU"
for MCU Peer.dataTransferState
event triggers parameter payloadstate
asERROR
.- ABORT step and return error.
- If MCU Peer connection messaging Datachannel has not been opened: This can be checked with
dataChannelState
event triggering parameter payloadstate
asOPEN
,peerId
value as"MCU"
andchannelType
asMESSAGING
for MCU Peer.dataTransferState
event triggers parameter payloadstate
asERROR
.- ABORT step and return error.
- If MCU Peer connection is not stable: The stable state can be checked with
- Checks if should open a new data Datachannel.
- If Peer supports simultaneous data transfer, open new data Datachannel: If MCU is connected,
this opens a new data Datachannel with MCU Peer with all the Peers IDs information that supports
simultaneous data transfers targeted for the data transfer session instead of opening new data Datachannel
with all Peers targeted for the data transfer session.
dataChannelState
event triggers parameter payloadstate
asCONNECTING
andchannelType
asDATA
. Note that there is no timeout to wait for parameter payloadstate
to beOPEN
.- If Datachannel has been created and opened successfully:
dataChannelState
event triggers parameter payloadstate
asOPEN
andchannelType
asDATA
.
- Else:
dataChannelState
event triggers parameter payloadstate
asCREATE_ERROR
andchannelType
asDATA
.dataTransferState
event triggers parameter payloadstate
asERROR
.- ABORT step and return error.
- Else: If MCU is connected,
this uses the messaging Datachannel with MCU Peer with all the Peers IDs information that supports
simultaneous data transfers targeted for the data transfer session instead of using the messaging Datachannels
with all Peers targeted for the data transfer session.
- If messaging Datachannel connection has a
data transfer in-progress:
dataTransferState
event triggers parameter payloadstate
asERROR
.- ABORT step and return error.
- If there is any conflicting
streamData()
method data streaming session: IfsendChunksAsBinary
is provided astrue
, it cannot start if existing data streaming session is expected binary data chunks, and if provided asfalse
, or method invoked issendURLData()
method, or Peer is using string data chunks fallback due to its support despite provided astrue
, it cannot start if existing data streaming session is expected string data chunks.dataTransferState
event triggers parameter payloadstate
asERROR
.- ABORT step and return error.
- If messaging Datachannel connection has a
data transfer in-progress:
- If Peer supports simultaneous data transfer, open new data Datachannel: If MCU is connected,
this opens a new data Datachannel with MCU Peer with all the Peers IDs information that supports
simultaneous data transfers targeted for the data transfer session instead of opening new data Datachannel
with all Peers targeted for the data transfer session.
- If Peer connection or session does not exists:
incomingDataRequest
event triggers.- For User only
dataTransferState
event triggers parameter payloadstate
asUSER_UPLOAD_REQUEST
. - For Peer only
dataTransferState
event triggers parameter payloadstate
asUPLOAD_REQUEST
. - Peer invokes
acceptDataTransfer()
method.- If parameter
accept
value istrue
:- User starts upload data transfer to Peer.
- For User only
dataTransferState
event triggers parameter payloadstate
asUPLOAD_STARTED
. - For Peer only
dataTransferState
event triggers parameter payloadstate
asDOWNLOAD_STARTED
.
- For User only
- If Peer / User invokes
cancelDataTransfer()
method:dataTransferState
event triggers parameterstate
asCANCEL
.- ABORT step and return error.
- If data transfer has timeout errors:
dataTransferState
event triggers parameterstate
asERROR
.- ABORT step and return error.
- Checks for Peer connection and Datachannel connection during data transfer:
- If MCU is enabled for the App Key provided in
init()
method and connected:- If MCU Datachannel has closed abruptly during data transfer:
-
This can be checked with
dataTransferState
event triggers parameterstate
asERROR
.- ABORT step and return error.
dataChannelState
event triggering parameter payloadstate
asCLOSED
,peerId
value as"MCU"
andchannelType
asDATA
for targeted Peers that supports simultaneous data transfer orMESSAGING
for targeted Peers that do not support it.
- If MCU Datachannel has closed abruptly during data transfer:
- If MCU Peer connection has changed from not being stable:
-
This can be checked with
dataTransferState
event triggers parameterstate
asERROR
.- ABORT step and return error.
peerConnection
event triggering parameter payloadstate
as notSTABLE
,peerId
value as"MCU"
.
- If MCU is enabled for the App Key provided in
- If Peer connection has changed from not being stable:
-
This can be checked with
dataTransferState
event triggers parameterstate
asERROR
.- ABORT step and return error.
peerConnection
event triggering parameter payloadstate
as notSTABLE
.
- User starts upload data transfer to Peer.
- If parameter
- Else:
- If Datachannel has closed abruptly during data transfer:
This can be checked with
dataChannelState
event triggering parameter payloadstate
asCLOSED
andchannelType
asDATA
for Peer that supports simultaneous data transfer orMESSAGING
for Peer that do not support it.dataTransferState
event triggers parameterstate
asERROR
.- ABORT step and return error.
- If Datachannel has closed abruptly during data transfer:
This can be checked with
- For User only
dataTransferState
event triggers parameter payloadstate
asUPLOADING
. - For Peer only
dataTransferState
event triggers parameter payloadstate
asDOWNLOADING
.
incomingData
event triggers.- For User only
dataTransferState
event triggers parameter payloadstate
asUPLOAD_COMPLETED
. - For Peer only
dataTransferState
event triggers parameter payloadstate
asDOWNLOAD_COMPLETED
.
accept
value is false
: - For User only
dataTransferState
event triggers parameter payloadstate
asREJECTED
. - For Peer only
dataTransferState
event triggers parameter payloadstate
asUSER_REJECTED
. - ABORT step and return error.
Parameters:
-
data
{Blob}The Blob object.
-
timeout
{Number} OptionalDEFAULT:60
The timeout to wait for response from Peer.
-
targetPeerId
{String | Array} OptionalThe target Peer ID to start data transfer with.
- When provided as an Array, it will start uploading data transfers with all connections with all the Peer IDs provided.
- When not provided, it will start uploading data transfers with all the currently connected Peers in the Room.
-
sendChunksAsBinary
{Boolean} OptionalDEFAULT:false
Note that this is currently not supported for MCU enabled Peer connections or Peer connections connecting from Android, iOS and Linux SDKs. This would fallback to
The flag if data transfer binary data chunks should not be encoded as Base64 string during data transfers.transferInfo.chunkType
toBINARY_STRING
when MCU is connected. -
callback
{Function} OptionalThe callback function fired when request has completed. Function parameters signature is
function (error, success)
Function request completion is determined by thedataTransferState
event triggeringstate
parameter payload asUPLOAD_COMPLETED
for all Peers targeted for request success.-
error
{JSON}The error result in request. Defined as
null
when there are no errors in request-
transferId
{String}The data transfer ID. Defined asnull
whensendBlobData()
fails to start data transfer. -
listOfPeers
{Array}The list Peer IDs targeted for the data transfer. -
transferErrors
{JSON}The list of data transfer errors. -
transferErrors.#peerId
{Error | String}The data transfer error associated with the Peer ID defined in#peerId
property. If#peerId
value is"self"
, it means that it is the error when there are no Peer connections to start data transfer with. -
transferInfo
{JSON}The data transfer information. Object signature matches thetransferInfo
parameter payload received in thedataTransferState
event except without thepercentage
anddata
property.
-
-
success
{JSON}The success result in request. Defined as
null
when there are errors in request-
transferId
{String}The data transfer ID. -
listOfPeers
{Array}The list Peer IDs targeted for the data transfer. -
transferInfo
{JSON}The data transfer information. Object signature matches thetransferInfo
parameter payload received in thedataTransferState
event except without thepercentage
property anddata
.
-
-
sendMessage
message
,
[targetPeerId]
,
)
Note that broadcasted events fromFunction that sends a message to Peers via the Signaling socket connection.muteStream()
method,stopStream()
method,stopScreen()
method,sendMessage()
method,unlockRoom()
method andlockRoom()
method may be queued when sent within less than an interval.
Example:
// Example 1: Broadcasting to all Peers skylinkDemo.sendMessage("Hi all!");
// Example 2: Sending to specific Peers var peersInExclusiveParty = [];
skylinkDemo.on("peerJoined", function (peerId, peerInfo, isSelf) { if (isSelf) return; if (peerInfo.userData.exclusive) { peersInExclusiveParty.push(peerId); } });
function updateExclusivePartyStatus (message) { skylinkDemo.sendMessage(message, peersInExclusiveParty); }
Events Sequence:
- Sends socket connection message to all targeted Peers via Signaling server.
incomingMessage
event triggers parameter payloadmessage.isDataChannel
value asfalse
.
Parameters:
-
message
{String | JSON}The message.
-
targetPeerId
{String | Array} OptionalThe target Peer ID to send message to.
- When provided as an Array, it will send the message to only Peers which IDs are in the list.
- When not provided, it will broadcast the message to all connected Peers in the Room.
sendP2PMessage
message
,
[targetPeerId]
,
)
Function that sends a message to Peers via the Datachannel connection.
Consider using sendURLData()
method if you are
sending large strings to Peers.
Example:
// Example 1: Broadcasting to all Peers skylinkDemo.on("dataChannelState", function (state, peerId, error, channelName, channelType) { if (state === skylinkDemo.DATA_CHANNEL_STATE.OPEN && channelType === skylinkDemo.DATA_CHANNEL_TYPE.MESSAGING) { skylinkDemo.sendP2PMessage("Hi all!"); } });
// Example 2: Sending to specific Peers var peersInExclusiveParty = [];
skylinkDemo.on("peerJoined", function (peerId, peerInfo, isSelf) { if (isSelf) return; if (peerInfo.userData.exclusive) { peersInExclusiveParty[peerId] = false; } });
skylinkDemo.on("dataChannelState", function (state, peerId, error, channelName, channelType) { if (state === skylinkDemo.DATA_CHANNEL_STATE.OPEN && channelType === skylinkDemo.DATA_CHANNEL_TYPE.MESSAGING) { peersInExclusiveParty[peerId] = true; } });
function updateExclusivePartyStatus (message) { var readyToSend = []; for (var p in peersInExclusiveParty) { if (peersInExclusiveParty.hasOwnProperty(p)) { readyToSend.push(p); } } skylinkDemo.sendP2PMessage(message, readyToSend); }
Events Sequence:
- Sends P2P message to all targeted Peers.
- If Peer connection Datachannel has not been opened: This can be checked with
dataChannelState
event triggering parameter payloadstate
asOPEN
andchannelType
asMESSAGING
for Peer.dataChannelState
event triggers parameter payloadstate
asSEND_MESSAGE_ERROR
.- ABORT step and return error.
incomingMessage
event triggers parameter payloadmessage.isDataChannel
value astrue
andisSelf
value astrue
.
- If Peer connection Datachannel has not been opened: This can be checked with
Parameters:
-
message
{String | JSON}The message.
-
targetPeerId
{String | Array} OptionalThe target Peer ID to send message to.
- When provided as an Array, it will send the message to only Peers which IDs are in the list.
- When not provided, it will broadcast the message to all connected Peers with Datachannel connection in the Room.
sendStream
options
,
[callback]
,
)
Note that ifFunction that sends a newshareScreen()
Stream is available despite havinggetUserMedia()
Stream available, theshareScreen()
Stream is sent instead of thegetUserMedia()
Stream to Peers.
getUserMedia()
Stream
to all connected Peers in the Room.
Example:
// Example 1: Send MediaStream object before being connected to Room function retrieveStreamBySourceForFirefox (sourceId) { navigator.mediaDevices.getUserMedia({ audio: true, video: { sourceId: { exact: sourceId } } }).then(function (stream) { skylinkDemo.sendStream(stream, function (error, success) { if (err) return; if (stream === success) { console.info("Same MediaStream has been sent"); } console.log("Stream is now being sent to Peers"); attachMediaStream(document.getElementById("my-video"), success); }); }); }
// Example 2: Send video after being connected to Room function sendVideo () { skylinkDemo.joinRoom(function (jRError, jRSuccess) { if (jRError) return; skylinkDemo.sendStream({ audio: true, video: true }, function (error, success) { if (error) return; console.log("getUserMedia() Stream with video is now being sent to Peers"); attachMediaStream(document.getElementById("my-video"), success); }); }); }
Events Sequence:
- Checks
options
provided.- If provided parameter
options
is not valid:- ABORT and return error.
- Else if provided parameter
options
is a Stream object:- Checks if there is any audio or video tracks.
- If there is no tracks:
- ABORT and return error.
- Else:
- Set
options.audio
value astrue
if Stream has audio tracks. - Set
options.video
value asfalse
if Stream has video tracks. - Mutes / Unmutes audio and video tracks based on current muted settings in
peerInfo.mediaStatus
. This can be retrieved withgetPeerInfo()
method. - If there is any previous
getUserMedia()
Stream:- Invokes
stopStream()
method to stop previous Stream.
- Invokes
mediaAccessSuccess
event triggers parameter payloadisScreensharing
value asfalse
andisAudioFallback
value asfalse
.
- Set
- If there is no tracks:
- Checks if there is any audio or video tracks.
- Else:
- Invoke
getUserMedia()
method withoptions
provided insendStream()
.- If request has errors:
- ABORT and return error.
- If request has errors:
- Invoke
- If provided parameter
- If there is currently no
shareScreen()
Stream and User is in Room:incomingStream
event triggers parameter payloadisSelf
value astrue
andstream
asgetUserMedia()
Stream.peerUpdated
event triggers parameter payloadisSelf
value astrue
.- Checks if MCU is enabled for App Key provided in
init()
method.- If MCU is enabled:
- Invoke
refreshConnection()
method.- If request has errors:
- ABORT and return error.
- If request has errors:
- Invoke
- Else:
- If there are connected Peers in the Room:
- Invoke
refreshConnection()
method.- If request has errors:
- ABORT and return error.
- If request has errors:
- Invoke
- If there are connected Peers in the Room:
- If MCU is enabled:
Parameters:
-
options
{JSON | MediaStream}The
getUserMedia()
methodoptions
parameter settings.- When provided as a
MediaStream
object, this configures theoptions.audio
andoptions.video
based on the tracks available in theMediaStream
object, and configures theoptions.audio.mute
andoptions.video.mute
based on the tracks.enabled
flags in the tracks provided in theMediaStream
object without invokinggetUserMedia()
method. Object signature matches theoptions
parameter in thegetUserMedia()
method.
- When provided as a
-
callback
{Function} OptionalThe callback function fired when request has completed. Function parameters signature is
function (error, success)
Function request completion is determined by themediaAccessSuccess
event triggeringisScreensharing
parameter payload value asfalse
for request success when User is in Room without Peers, or by thepeerRestart
event triggeringisSelfInitiateRestart
parameter payload value astrue
for all connected Peers for request success when User is in Room with Peers.-
error
{Error | String}The error result in request. Defined as
null
when there are no errors in request Object signature is thegetUserMedia()
method error or when invalidoptions
is provided. -
success
{MediaStream}The success result in request. Defined as
null
when there are errors in request Object signature is thegetUserMedia()
method Stream object.
-
sendURLData
data
,
[timeout=60]
,
[targetPeerId]
,
[callback]
,
)
Function that starts an uploading string data transfer from User to Peers.
Example:
<body> <input type="radio" name="timeout" onchange="setTransferTimeout(0)"> 1s timeout (Default) <input type="radio" name="timeout" onchange="setTransferTimeout(120)"> 2s timeout <input type="radio" name="timeout" onchange="setTransferTimeout(300)"> 5s timeout <hr> <input type="file" onchange="showImage(this.files[0], this.getAttribute('data'))" data="peerId"> <input type="file" onchange="showImageGroup(this.files[0], this.getAttribute('data').split(',')))" data="peerIdA,peerIdB"> <input type="file" onchange="showImageAll(this.files[0])" data=""> <image id="target-1" src=""> <image id="target-2" src=""> <image id="target-3" src=""> <script> var transferTimeout = 0;
function setTransferTimeout (timeout) { transferTimeout = timeout; }
function retrieveImageDataURL(file, cb) { var fr = new FileReader(); fr.onload = function () { cb(fr.result); }; fr.readAsDataURL(files[0]); }
// Example 1: Send image data URL to a Peer function showImage (file, peerId) { var cb = function (error, success) { if (error) return; console.info("Image has been transferred to '" + peerId + "' successfully"); }; retrieveImageDataURL(file, function (str) { if (transferTimeout > 0) { skylinkDemo.sendURLData(str, peerId, transferTimeout, cb); } else { skylinkDemo.sendURLData(str, peerId, cb); } document.getElementById("target-1").src = str; }); }
// Example 2: Send image data URL to a list of Peers function showImageGroup (file, peerIds) { var cb = function (error, success) { var listOfPeers = error ? error.listOfPeers : success.listOfPeers; var listOfPeersErrors = error ? error.transferErrors : {}; for (var i = 0; i < listOfPeers.length; i++) { if (listOfPeersErrors[listOfPeers[i]]) { console.error("Failed image transfer to '" + listOfPeers[i] + "'"); } else { console.info("Image has been transferred to '" + listOfPeers[i] + "' successfully"); } } }; retrieveImageDataURL(file, function (str) { if (transferTimeout > 0) { skylinkDemo.sendURLData(str, peerIds, transferTimeout, cb); } else { skylinkDemo.sendURLData(str, peerIds, cb); } document.getElementById("target-2").src = str; }); }
// Example 2: Send image data URL to a list of Peers function uploadFileAll (file) { var cb = function (error, success) { var listOfPeers = error ? error.listOfPeers : success.listOfPeers; var listOfPeersErrors = error ? error.transferErrors : {}; for (var i = 0; i < listOfPeers.length; i++) { if (listOfPeersErrors[listOfPeers[i]]) { console.error("Failed image transfer to '" + listOfPeers[i] + "'"); } else { console.info("Image has been transferred to '" + listOfPeers[i] + "' successfully"); } } }; retrieveImageDataURL(file, function (str) { if (transferTimeout > 0) { skylinkDemo.sendURLData(str, transferTimeout, cb); } else { skylinkDemo.sendURLData(str, cb); } document.getElementById("target-3").src = str; }); } </script> </body>
Events Sequence:
Event sequence followssendBlobData()
method.
Parameters:
-
data
{String}The data string to transfer to Peer.
-
timeout
{Number} OptionalDEFAULT:60
The timeout to wait for response from Peer.
-
targetPeerId
{String | Array} OptionalThe target Peer ID to start data transfer with.
- When provided as an Array, it will start uploading data transfers with all connections with all the Peer IDs provided.
- When not provided, it will start uploading data transfers with all the currently connected Peers in the Room.
-
callback
{Function} OptionalThe callback function fired when request has completed. Function parameters signature is
function (error, success)
Function request completion is determined by thedataTransferState
event triggeringstate
parameter payload asUPLOAD_COMPLETED
for all Peers targeted for request success.-
error
{JSON}The error result in request. Defined as
null
when there are no errors in request-
transferId
{String}The data transfer ID. Defined asnull
whensendURLData()
fails to start data transfer. -
listOfPeers
{Array}The list Peer IDs targeted for the data transfer. -
transferErrors
{JSON}The list of data transfer errors. -
transferErrors.#peerId
{Error | String}The data transfer error associated with the Peer ID defined in#peerId
property. If#peerId
value is"self"
, it means that it is the error when there are no Peer connections to start data transfer with. -
transferInfo
{JSON}The data transfer information. Object signature matches thetransferInfo
parameter payload received in thedataTransferState
event except without thepercentage
property anddata
.
-
-
success
{JSON}The success result in request. Defined as
null
when there are errors in request-
transferId
{String}The data transfer ID. -
listOfPeers
{Array}The list Peer IDs targeted for the data transfer. -
transferInfo
{JSON}The data transfer information. Object signature matches thetransferInfo
parameter payload received in thedataTransferState
event except without thepercentage
property anddata
.
-
-
setDebugMode
[options=false]
,
)
Function that configures the debugging mode of the SDK.
Example:
// Example 1: Enable both options.storeLogs and options.trace skylinkDemo.setDebugMode(true);
// Example 2: Enable only options.storeLogs skylinkDemo.setDebugMode({ storeLogs: true });
// Example 3: Disable debugging mode skylinkDemo.setDebugMode();
Events Sequence:
There is no event sequence for this method.Parameters:
-
options
{Boolean | JSON} OptionalDEFAULT:false
The debugging options.
- When provided as a boolean, this sets both
options.trace
andoptions.storeLogs
to its boolean value.
-
trace
{Boolean} OptionalDEFAULT:false
The flag if SDK
console
logs should output asconsole.trace()
logs for tracing theFunction
call stack. Note that theconsole.trace()
output logs is determined by the log level setsetLogLevel()
method. Ifconsole.trace()
API is not supported,setDebugMode()
will fallback to useconsole.log()
API. -
storeLogs
{Boolean} OptionalDEFAULT:false
The flag if SDK should store the
console
logs. This is required to be enabled forSkylinkLogs
API. -
printTimestamp
{Boolean} OptionalDEFAULT:false
The flag if SDK should print the timestamp of the
console
logs.
- When provided as a boolean, this sets both
setLogLevel
[logLevel]
,
)
Function that configures the level of console
API logs to be printed in the
Javascript Web Console.
Example:
// Example 1: Print all of the console.debug, console.log, console.info, console.warn and console.error logs. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.DEBUG);
// Example 2: Print only the console.log, console.info, console.warn and console.error logs. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.LOG);
// Example 3: Print only the console.info, console.warn and console.error logs. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.INFO);
// Example 4: Print only the console.warn and console.error logs. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.WARN);
// Example 5: Print only the console.error logs. This is done by default. skylinkDemo.setLogLevel(skylinkDemo.LOG_LEVEL.ERROR);
Events Sequence:
There is no event sequence for this method.Parameters:
-
logLevel
{Number} OptionalThe specific log level of logs to return.
- When not provided or that the level does not exists, it will not overwrite the current log level.
By default, the initial log level is
ERROR
. [Rel: Skylink.LOG_LEVEL]
- When not provided or that the level does not exists, it will not overwrite the current log level.
By default, the initial log level is
setUserData
userData
,
)
Function that overwrites the User current custom data.
Example:
// Example 1: Set/Update User custom data before joinRoom() var userData = "beforejoin";
skylinkDemo.setUserData(userData);
skylinkDemo.joinRoom(function (error, success) { if (error) return; if (success.peerInfo.userData === userData) { console.log("User data is sent"); } });
// Example 2: Update User custom data after joinRoom() var userData = "afterjoin";
skylinkDemo.joinRoom(function (error, success) { if (error) return; skylinkDemo.setUserData(userData); if (skylinkDemo.getPeerInfo().userData === userData) { console.log("User data is updated and sent"); } });
Events Sequence:
- Updates User custom data.
- If User is in Room:
peerUpdated
event triggers with parameter payloadisSelf
value astrue
.
- If User is in Room:
Parameters:
-
userData
{JSON | String}The updated custom data.
startRecording
[callback]
,
)
Note that this feature requires MCU and recording to be enabled for the App Key provided in the
init()
method. If recording feature is not available to
be enabled in the Developer Console, please
contact us on our support portal.
Starts a recording session.
Example:
// Example 1: Start recording session skylinkDemo.startRecording(function (error, success) { if (error) return; console.info("Recording session has started. ID ->", success); });
Events Sequence:
- If MCU is not connected:
- ABORT and return error.
- If there is an existing recording session currently going on:
- ABORT and return error.
- Sends to MCU via Signaling server to start recording session.
- If recording session has been started successfully:
recordingState
event triggers parameter payloadstate
asSTART
.
- If recording session has been started successfully:
Parameters:
-
callback
{Function} OptionalThe callback function fired when request has completed. Function parameters signature is
function (error, success)
Function request completion is determined by therecordingState
event triggeringstate
parameter payload asSTART
.-
error
{Error | String}The error result in request. Defined as
null
when there are no errors in request Object signature is thestartRecording()
error when starting a new recording session. -
success
{String | JSON}The success result in request. Defined as
null
when there are errors in request Object signature is therecordingState
event triggeredrecordingId
parameter payload.
-
startRTMPSession
[callback]
,
)
Note that this feature requires MCU to be enabled for the App Key provided in the
init()
method.
Starts a RTMP session.
Example:
// Example 1: Start RTMP session skylinkDemo.startRTMPSession(function (error, success) { if (error) return; console.info("RTMP session has started. ID ->", success); });
Events Sequence:
- If MCU is not connected:
- ABORT and return error.
- Sends to MCU via Signaling server to start RTMP session.
- If RTMP session has been started successfully:
RTMPState
event triggers parameter payloadstate
asSTART
.
- If RTMP session has been started successfully:
Parameters:
-
callback
{Function} OptionalThe callback function fired when request has completed. Function parameters signature is
function (error, success)
Function request completion is determined by thertmpState
event triggeringstate
parameter payload asSTART
.-
error
{Error | String}The error result in request. Defined as
null
when there are no errors in request Object signature is thestartRTMPSession()
error when starting a new rtmp session. -
success
{String | JSON}The success result in request. Defined as
null
when there are errors in request Object signature is theRTMPState
event triggeredRTMPId
parameter payload.
-
startStreamingData
[isStringStream=false]
,
[targetPeerId]
,
)
Note that this feature is not supported by MCU enabled Peer connections and theFunction that starts a data chunks streaming session from User to Peers.enableSimultaneousTransfers
flag has to be enabled in theinit()
method in order for this functionality to work.
To start streaming data, see thestreamData()
method. To stop data streaming session, see thestopStreamingData()
method.
Example:
// Example 1: Start streaming to all Peers skylinkDemo.on("dataChannelState", function (state, peerId, error, channelName, channelType) { if (state === skylinkDemo.DATA_CHANNEL_STATE.OPEN && channelType === skylinkDemo.DATA_CHANNEL_TYPE.MESSAGING) { skylinkDemo.startStreamingData(false); } });
// Example 2: Start streaming to specific Peers var peersInExclusiveParty = [];
skylinkDemo.on("peerJoined", function (peerId, peerInfo, isSelf) { if (isSelf) return; if (peerInfo.userData.exclusive) { peersInExclusiveParty[peerId] = false; } });
skylinkDemo.on("dataChannelState", function (state, peerId, error, channelName, channelType) { if (state === skylinkDemo.DATA_CHANNEL_STATE.OPEN && channelType === skylinkDemo.DATA_CHANNEL_TYPE.MESSAGING) { peersInExclusiveParty[peerId] = true; } });
function updateExclusivePartyStatus (message) { var readyToSend = []; for (var p in peersInExclusiveParty) { if (peersInExclusiveParty.hasOwnProperty(p)) { readyToSend.push(p); } } skylinkDemo.startStreamingData(message, readyToSend); }
Events Sequence:
- Checks if User is in Room.
- If User is not in Room:
-
dataStreamState
event triggers parameter payloadstate
asSTART_ERROR
. - ABORT step and return error.
-
- If User is not in Room:
- Checks if there is any available Datachannel connections.
- If User is not in Room:
-
dataStreamState
event triggers parameter payloadstate
asSTART_ERROR
. - ABORT step and return error.
-
- If User is not in Room:
- Checks if Peer connection and Datachannel connection are in correct states.
- If Peer connection or session does not exists:
-
dataStreamState
event triggers parameter payloadstate
asSTART_ERROR
. - ABORT step and return error.
-
- If Peer connection messaging Datachannel has not been opened: This can be checked with
dataChannelState
event triggering parameter payloadstate
asOPEN
andchannelType
asMESSAGING
for Peer.-
dataStreamState
event triggers parameter payloadstate
asSTART_ERROR
. - ABORT step and return error.
-
- If MCU is enabled for the App Key provided in
init()
method and connected:- If MCU Peer connection messaging Datachannel has not been opened: This can be checked with
dataChannelState
event triggering parameter payloadstate
asOPEN
,peerId
value as"MCU"
andchannelType
asMESSAGING
for MCU Peer.dataStreamState
event triggers parameter payloadstate
asSTART_ERROR
.- ABORT step and return error.
- If MCU Peer connection messaging Datachannel has not been opened: This can be checked with
- Checks if should open a new data Datachannel.
- If Peer supports simultaneous data streaming, open new data Datachannel: If MCU is connected,
this opens a new data Datachannel with MCU Peer with all the Peers IDs information that supports
simultaneous data transfers targeted for the data streaming session instead of opening new data Datachannel
with all Peers targeted for the data streaming session.
dataChannelState
event triggers parameter payloadstate
asCONNECTING
andchannelType
asDATA
. Note that there is no timeout to wait for parameter payloadstate
to beOPEN
.- If Datachannel has been created and opened successfully:
dataChannelState
event triggers parameter payloadstate
asOPEN
andchannelType
asDATA
.
- Else:
dataChannelState
event triggers parameter payloadstate
asCREATE_ERROR
andchannelType
asDATA
.dataStreamState
event triggers parameter payloadstate
asSTART_ERROR
.- ABORT step and return error.
- Else: If MCU is connected,
this uses the messaging Datachannel with MCU Peer with all the Peers IDs information that supports
simultaneous data transfers targeted for the data streaming session instead of using the messaging Datachannels
with all Peers targeted for the data streaming session.
- If messaging Datachannel connection has a
data streaming in-progress:
dataStreamState
event triggers parameter payloadstate
asSTART_ERROR
.- ABORT step and return error.
- If there is any conflicting
streamData()
method data streaming session: IfisStringStream
is provided astrue
andsendBlobData()
method orsendURLData()
method has an existing binary string transfer, it cannot start string data streaming session. Else ifsendBlobData()
method has an existing binary data transfer, it cannot start binary data streaming session.dataStreamState
event triggers parameter payloadstate
asSTART_ERROR
.- ABORT step and return error.
- If messaging Datachannel connection has a
data streaming in-progress:
- If Peer supports simultaneous data streaming, open new data Datachannel: If MCU is connected,
this opens a new data Datachannel with MCU Peer with all the Peers IDs information that supports
simultaneous data transfers targeted for the data streaming session instead of opening new data Datachannel
with all Peers targeted for the data streaming session.
- If Peer connection or session does not exists:
incomingDataStreamStarted
event triggers.- For User only
dataStreamState
event triggers parameter payloadstate
asSENDING_STARTED
. - For Peer only
dataStreamState
event triggers parameter payloadstate
asRECEIVING_STARTED
.
Parameters:
-
isStringStream
{Boolean} OptionalDEFAULT:false
The flag if data streaming session sending data chunks should be expected as string data chunks sent. By default, data chunks are expected to be sent in Blob or ArrayBuffer, and ArrayBuffer data chunks will be converted to Blob.
-
targetPeerId
{String | Array} OptionalThe target Peer ID to send message to.
- When provided as an Array, it will start streaming session to only Peers which IDs are in the list.
- When not provided, it will start the streaming session to all connected Peers with Datachannel connection in the Room.
stopRecording
[callback]
,
[callbackSuccessWhenLink=false]
,
)
Note that this feature requires MCU and recording to be enabled for the App Key provided in the
init()
method. If recording feature is not available to
be enabled in the Developer Console, please
contact us on our support portal.
Stops a recording session.
Example:
// Example 1: Stop recording session skylinkDemo.stopRecording(function (error, success) { if (error) return; console.info("Recording session has stopped. ID ->", success); });
// Example 2: Stop recording session with mixin videos link skylinkDemo.stopRecording(function (error, success) { if (error) return; console.info("Recording session has compiled with links ->", success.link); }, true);
Events Sequence:
- If MCU is not connected:
- ABORT and return error.
- If there is no existing recording session currently going on:
- ABORT and return error.
- If existing recording session recording time has not elapsed more than 4 seconds:
4 seconds is mandatory for recording session to ensure better recording
experience and stability.
- ABORT and return error.
- Sends to MCU via Signaling server to stop recording session:
- If recording session has been stopped successfully:
recordingState
event triggers parameter payloadstate
asSTART
.- MCU starts mixin recorded session videos:
- If recording session has been mixin successfully with links:
recordingState
event triggers parameter payloadstate
asLINK
.- Else:
recordingState
event triggers parameter payloadstate
asERROR
.- ABORT and return error.
- If recording session has been mixin successfully with links:
- Else:
recordingState
event triggers parameter payloadstate
asERROR
.- ABORT and return error.
- If recording session has been stopped successfully:
Parameters:
-
callback
{Function} OptionalThe callback function fired when request has completed. Function parameters signature is
function (error, success)
Function request completion is determined by therecordingState
event triggeringstate
parameter payload asSTOP
or asLINK
when the value ofcallbackSuccessWhenLink
istrue
.-
error
{Error | String}The error result in request. Defined as
null
when there are no errors in request Object signature is thestopRecording()
error when stopping current recording session. -
success
{String | JSON}The success result in request.
- When
callbackSuccessWhenLink
value isfalse
, it is defined as string as the recording session ID. - when
callbackSuccessWhenLink
value istrue
, it is defined as an object as the recording session information. Defined asnull
when there are errors in request
-
recordingId
{JSON}The recording session ID. -
link
{JSON}The recording session mixin videos link in MP4 format. Object signature matches thelink
parameter payload received in therecordingState
event.
- When
-
-
callbackSuccessWhenLink
{Boolean} OptionalDEFAULT:false
The flag if
callback
function provided should result in success only whenrecordingState
event triggeringstate
parameter payload asLINK
.
stopRTMPSession
[callback]
,
)
Note that this feature requires MCU to be enabled for the App Key provided in the
init()
method.
Stops a RTMP session.
Example:
// Example 1: Stop RTMP session skylinkDemo.stopRTMPSession(function (error, success) { if (error) return; console.info("RTMP session has stopped. ID ->", success); });
Events Sequence:
There is no event sequence for this method.Parameters:
-
callback
{Function} OptionalThe callback function fired when request has completed. Function parameters signature is
function (error, success)
Function request completion is determined by theRTMPState
event triggeringstate
parameter payload asSTOP
-
error
{Error | String}The error result in request. Defined as
null
when there are no errors in request Object signature is thestopRTMPSession()
error when stopping current RTMP session. -
success
{String | JSON}The success result in request.
-
stopScreen
()
Note that broadcasted events fromFunction that stopsmuteStream()
method,stopStream()
method,stopScreen()
method,sendMessage()
method,unlockRoom()
method andlockRoom()
method may be queued when sent within less than an interval.
shareScreen()
Stream.
Example:
function stopScreen () { skylinkDemo.stopScreen(); }
skylinkDemo.shareScreen();
Events Sequence:
- Checks if there is
shareScreen()
Stream.- If there is
shareScreen()
Stream:- Stop
shareScreen()
Stream Stream.mediaAccessStopped
event triggers parameter payloadisScreensharing
value astrue
andisAudioFallback
value asfalse
.- If User is in Room:
streamEnded
event triggers parameter payloadisSelf
value astrue
andisScreensharing
value astrue
.peerUpdated
event triggers parameter payloadisSelf
value astrue
.
- If User is in Room: SKIP this step if
stopScreen()
was invoked fromshareScreen()
method.- If there is
getUserMedia()
Stream Stream:incomingStream
event triggers parameter payloadisSelf
value astrue
andstream
asgetUserMedia()
Stream.peerUpdated
event triggers parameter payloadisSelf
value astrue
.
- Invoke
refreshConnection()
method.
- If there is
- Stop
- If there is
stopStream
()
Note that broadcasted events fromFunction that stopsmuteStream()
method,stopStream()
method,stopScreen()
method,sendMessage()
method,unlockRoom()
method andlockRoom()
method may be queued when sent within less than an interval.
getUserMedia()
Stream.
Example:
function stopStream () { skylinkDemo.stopStream(); }
skylinkDemo.getUserMedia();
Events Sequence:
- Checks if there is
getUserMedia()
Stream.- If there is
getUserMedia()
Stream:- Stop
getUserMedia()
Stream Stream.mediaAccessStopped
event triggers parameter payloadisScreensharing
value asfalse
.- If User is in Room:
streamEnded
event triggers parameter payloadisSelf
value astrue
andisScreensharing
value asfalse
.peerUpdated
event triggers parameter payloadisSelf
value astrue
.
- Stop
- If there is
stopStreamingData
streamId
,
)
To start data streaming session, see theFunction that stops a data chunks streaming session from User to Peers.startStreamingData()
method To start streaming data, see thestreamData()
method.
Example:
skylinkDemo.stopStreamData(streamId);
Events Sequence:
- Checks if Peer connection and Datachannel connection are in correct states.
- If Peer connection (or MCU Peer connection if enabled)
data streaming Datachannel has not been opened: This can be checked with
dataChannelState
event triggering parameter payloadstate
asOPEN
andchannelType
asMESSAGING
for Peer.-
dataStreamState
event triggers parameter payloadstate
asERROR
. - ABORT step and return error.
-
- If Peer connection (or MCU Peer connection if enabled)
data streaming Datachannel has not been opened: This can be checked with
- Stops the data streaming session to Peer.
incomingDataStreamStopped
event triggers.- For User only
dataStreamState
event triggers parameter payloadstate
asSENDING_STOPPED
. - For Peer only
dataStreamState
event triggers parameter payloadstate
asRECEIVING_STOPPED
.
Parameters:
-
streamId
{String}The data streaming session ID.
streamData
streamId
,
chunk
,
)
Note that this feature is not supported by MCU enabled Peer connections.Function that sends a data chunk from User to Peers for an existing active data streaming session.
To start data streaming session, see thestartStreamingData()
method. To stop data streaming session, see thestopStreamingData()
method
Example:
// Example 1: Start streaming var currentStreamId = null if (file.size > chunkLimit) { while ((file.size - 1) > endCount) { endCount = startCount + chunkLimit; chunks.push(file.slice(startCount, endCount)); startCount += chunkLimit; } if ((file.size - (startCount + 1)) > 0) { chunks.push(file.slice(startCount, file.size - 1)); } } else { chunks.push(file); } var processNextFn = function () { if (chunks.length > 0) { skylinkDemo.once("incomingDataStream", function () { setTimeout(processNextFn, 1); }, function (data, evtStreamId, evtPeerId, streamInfo, isSelf) { return isSelf && evtStreamId === currentStreamId; }); var chunk = chunks[0]; chunks.splice(0, 1); skylinkDemo.streamData(currentStreamId, chunk); } else { skylinkDemo.stopStreamingData(currentStreamId); } }; skylinkDemo.once("incomingDataStreamStarted", processNextFn, function (streamId, peerId, streamInfo, isSelf) { currentStreamId = streamId; return isSelf; }); skylinkDemo.once("incomingDataStreamStopped", function () { // Render file }, function (streamId, peerId, streamInfo, isSelf) { return currentStreamId === streamId && isSelf; }); skylinkDemo.startStreamingData(false);
Events Sequence:
- Checks if Peer connection and Datachannel connection are in correct states.
- If Peer connection (or MCU Peer connection if enabled)
data streaming Datachannel has not been opened: This can be checked with
dataChannelState
event triggering parameter payloadstate
asOPEN
andchannelType
asMESSAGING
for Peer.-
dataStreamState
event triggers parameter payloadstate
asERROR
. - ABORT step and return error.
-
- If Peer connection (or MCU Peer connection if enabled)
data streaming Datachannel has not been opened: This can be checked with
- Starts sending the data chunk to Peer.
incomingDataStream
event triggers.- For User only
dataStreamState
event triggers parameter payloadstate
asSENT
. - For Peer only
dataStreamState
event triggers parameter payloadstate
asRECEIVED
.
Parameters:
-
streamId
{String}The data streaming session ID.
-
chunk
{String | Blob | ArrayBuffer}The data chunk. By default when it is not string data streaming, data chunks when is are expected to be sent in Blob or ArrayBuffer, and ArrayBuffer data chunks will be converted to Blob. For binary data chunks, the limit is
65456
. For string data chunks, the limit is1212
.
unlockRoom
()
Note that broadcasted events fromFunction that unlocks the current Room when in session to allow other Peers to join the Room.muteStream()
method,stopStream()
method,stopScreen()
method,sendMessage()
method,unlockRoom()
method andlockRoom()
method may be queued when sent within less than an interval.
Events Sequence:
- Requests to Signaling server to unlock Room
roomLock
event triggers parameter payloadisLocked
value asfalse
.
SkylinkLogs
()
To utilise and enable theThe object interface to manage the SDK Javascript Web Console logs.SkylinkLogs
API functionalities, thesetDebugMode()
methodoptions.storeLogs
parameter has to be enabled.
SkylinkLogs.clearAllLogs
()
Function that clears all the current stored SDK console
logs.
Example:
// Example 1: Clear all the logs SkylinkLogs.clearAllLogs();
SkylinkLogs.getLogs
()
Function that gets the current stored SDK console
logs.
Parameters:
-
logLevel
{Number} OptionalThe specific log level of logs to return.
- When not provided or that the level does not exists, it will return all logs of all levels. [Rel: Skylink.LOG_LEVEL]
Returns:
The array of stored logs.
<#index>
{Array}The stored log item.
0
{Date}The DateTime of when the log was stored.
1
{String}The log level. [Rel: Skylink.LOG_LEVEL]
2
{String}The log message.
3
{Any}OptionalThe log message object.
Example:
// Example 1: Get logs of specific level var debugLogs = SkylinkLogs.getLogs(skylinkDemo.LOG_LEVEL.DEBUG);
// Example 2: Get all the logs var allLogs = SkylinkLogs.getLogs();
SkylinkLogs.printAllLogs
()
Function that prints all the current stored SDK console
logs into the
Javascript Web Console.
Example:
// Example 1: Print all the logs SkylinkLogs.printAllLogs();
_autoIntroduce
Attribute Type: {Boolean}
Stores the flag that indicates if "autoIntroduce" is enabled. If enabled, the Peers connecting the same Room will receive each others "enter" message ping.
Default value:
true
_channelOpen
Attribute Type: {Boolean}
Stores the flag that indicates if socket connection to the Signaling has opened.
_CHUNK_DATAURL_SIZE
Attribute Type: {Number}
Stores the data chunk size for data URI string transfers.
_clientId
Attribute Type: {Number}
Stores the unique random number used for generating the "client_id".
_currentRecordingId
Attribute Type: {JSON}
Stores the current active recording session ID. There can only be 1 recording session at a time in a Room
_dataChannels
Attribute Type: {JSON}
Stores the list of Peer Datachannel connections.
Keys:
-
#peerId
{JSON}The list of Datachannels associated with Peer ID.
-
#channelLabel
{RTCDataChannel}The Datachannel connection. The property name
"main"
is reserved for messaging Datachannel type.
-
_dataStreams
Attribute Type: {JSON}
Stores the list of sending data streaming sessions to Peers.
Keys:
-
#streamId
{JSON}The data stream session.
_dataTransfers
Attribute Type: {JSON}
Stores the list of data transfers from / to Peers.
Keys:
-
#transferId
{JSON}The data transfer session.
_DC_PROTOCOL_TYPE
Attribute Type: {JSON}
Stores the list of data transfer protocols.
Keys:
-
WRQ
{String}The protocol to initiate data transfer.
-
ACK
{String}The protocol to request for data transfer chunk. Give
-1
to reject the request at the beginning and0
to accept the data transfer request. -
CANCEL
{String}The protocol to terminate data transfer.
-
ERROR
{String}The protocol when data transfer has errors and has to be terminated.
-
MESSAGE
{String}The protocol that is used to send P2P messages.
_enableDebugMode
Attribute Type: {Boolean}
Stores the flag if debugging mode is enabled. This manipulates the SkylinkLogs interface.
Default value:
false
_enableDebugStack
Attribute Type: {Boolean}
Stores the flag if logs should be stored in SkylinkLogs interface.
Default value:
false
_enableDebugTrace
Attribute Type: {Boolean}
Stores the flag if logs should trace if available.
This uses the console.trace
API.
Default value:
false
_EVENTS
Attribute Type: {JSON}
Stores the list of on()
event handlers.
Keys:
-
<#event>
{Array}The list of event handlers associated with the event.
-
<#index>
{Function}The event handler function.
-
_gatheredCandidates
Attribute Type: {JSON}
Stores the list of Peer connection ICE candidates.
Keys:
-
<#peerId>
{JSON}The list of the Peer connection ICE candidates.
-
sending
{JSON}The list of the Peer connection ICE candidates sent.
-
receiving
{JSON}The list of the Peer connection ICE candidates received.
-
_GROUP_MESSAGE_LIST
Attribute Type: {Array}
Stores the list of socket messaging protocol types to queue when sent less than a second interval.
_joinRoomManager
Attribute Type: {Boolean}
Stores the flag to temporarily halt joinRoom() from processing.
_logLevel
Attribute Type: {String}
Stores the current SDK log level.
Default is ERROR (0
).
Default value:
0
_MOZ_BINARY_FILE_SIZE
Attribute Type: {Number}
Stores the data chunk size for binary Blob transfers.
_MOZ_CHUNK_FILE_SIZE
Attribute Type: {Number}
Stores the data chunk size for Blob transfers transferring from/to Firefox browsers due to limitation tested in the past in some PCs (linx predominatly).
_onceEvents
Attribute Type: {JSON}
Stores the list of once()
event handlers.
These events are only triggered once.
Keys:
-
<#event>
{Array}The list of event handlers associated with the event.
-
<#index>
{Array}The array of event handler function and its condition function.
-
_peerBandwidth
Attribute Type: {JSON}
Stores the list of the Peer connections stats.
Keys:
-
<#peerId>
{JSON}The Peer connection stats.
_peerCandidatesQueue
Attribute Type: {JSON}
Stores the list of buffered ICE candidates that is received before remote session description is received and set.
Keys:
-
<#peerId>
{Array}The list of the Peer connection buffered ICE candidates received.
-
<#index>
{RTCIceCandidate}The Peer connection buffered ICE candidate received.
-
_peerConnections
Attribute Type: {JSON}
Stores the list of the Peer connections.
Keys:
-
<#peerId>
{RTCPeerConnection}The Peer connection.
_peerEndOfCandidatesCounter
Attribute Type: {JSON}
Stores the list of ICE candidates received before signaling end.
_peerInformations
Attribute Type: {JSON}
Stores the list of Peers session information.
Keys:
-
<#peerId>
{JSON}The Peer session information.
-
userData
{JSON | String}The Peer custom data.
-
settings
{JSON}The Peer streaming information.
-
mediaStatus
{JSON}The Peer streaming muted status.
-
agent
{JSON}The Peer agent information.
-
_peerList
Attribute Type: {JSON}
Stores the list of Peers retrieved from the Signaling from getPeers()
method.
_peerPriorityWeight
Attribute Type: {Number}
Stores the User connection priority weight. If Peer has a higher connection weight, it will do the offer from its Peer connection first.
_peerStats
Attribute Type: {JSON}
Stores the list of the Peer connections stats.
Keys:
-
<#peerId>
{JSON}The Peer connection stats.
_printTimestamp
Attribute Type: {Boolean}
Stores the flag if logs should print timestamp.
Default value:
false
_recordingStartInterval
Attribute Type: {JSON}
Stores the recording session timeout to ensure 4 seconds has been recorded.
_retryCounters
Attribute Type: {JSON}
Stores the global number of Peer connection retries that would increase the wait-for-response timeout for the Peer connection health timer.
_room
Attribute Type: {JSON}
Stores the Room credentials information for joinRoom()
.
Keys:
-
id
{String}The "rid" for
joinRoom()
. -
token
{String}The "roomCred" for
joinRoom()
. -
startDateTime
{String}The "start" for
joinRoom()
. -
duration
{String}The "len" for
joinRoom()
. -
connection
{String}The RTCPeerConnection constraints and configuration. This is not used in the SDK except for the "mediaConstraints" property that sets the default
getUserMedia()
settings.
_SIG_MESSAGE_TYPE
Attribute Type: {JSON}
Stores the list of socket messaging protocol types.
See confluence docs for the list based on the current SM_PROTOCOL_VERSION
.
_socketMessageQueue
Attribute Type: {Array}
Stores the queued socket messages. This is to prevent too many sent over less than a second interval that might cause dropped messages or jams to the Signaling connection.
_socketMessageTimeout
Attribute Type: {Object}
Stores the setTimeout
to sent queued socket messages.
_socketPorts
Attribute Type: {JSON}
Stores the list of socket ports to use to connect to the Signaling. These ports are defined by default which is commonly used currently by the Signaling. Should re-evaluate this sometime.
Keys:
-
http:
{Array}The list of HTTP socket ports.
-
https:
{Array}The list of HTTPS socket ports.
_socketUseXDR
Attribute Type: {Boolean}
Stores the flag that indicates if XDomainRequest is used for IE 8/9.
_streamsBandwidthSettings
Attribute Type: {JSON}
Stores all the Stream sending maximum bandwidth settings.
_streamsSession
Attribute Type: {JSON}
Stores all the Stream sessions.
Defined as false
when Stream has already ended.
_transceiverIdPeerIdMap
Attribute Type: {Object}
(Extra) Tracks requested by the Peer/MCU in welcome/restart message. Used to create transceivers before createOffer.
_transceiverIdPeerIdMap
Attribute Type: {Object}
A mapping of transceiverIds and peer IDs (only when new MCU is in effect)
_user
Attribute Type: {JSON}
Stores the Signaling user credentials from the API response required for connecting to the Signaling server.
Keys:
-
uid
{String}The API result "username".
-
token
{String}The API result "userCred".
-
timeStamp
{String}The API result "timeStamp".
-
sid
{String}The Signaling server receive user Peer ID.
_userData
Attribute Type: {JSON | String}
Stores the User custom data.
By default, if no custom user data is set, it is an empty string ""
.
Default value:
""
_voiceActivityDetection
Attribute Type: {Boolean}
Stores the flag if voice activity detection should be enabled.
Default value:
true
AUDIO_CODEC
Attribute Type: {JSON}
Note that if the audio codec is not supported, the SDK will not configure the localThe list of available audio codecs to set as the preferred audio codec to use to encode sending audio data when available encoded audio codec for Peer connections configured in the"offer"
or"answer"
session description to prefer the codec.
init()
method.
Keys:
-
AUTO
{String}Value
"auto"
The value of the option to not prefer any audio codec but rather use the created local"offer"
/"answer"
session description audio codec preference. -
OPUS
{String}Value
"opus"
The value of the option to prefer the OPUS audio codec. -
ISAC
{String}Value
"ISAC"
The value of the option to prefer the ISAC audio codec. -
ILBC
{String}Value
"ILBC"
The value of the option to prefer the iLBC audio codec. -
G722
{String}Value
"G722"
The value of the option to prefer the G722 audio codec. -
PCMA
{String}Value
"PCMA"
The value of the option to prefer the G711u audio codec. -
PCMU
{String}Value
"PCMU"
The value of the option to prefer the G711a audio codec.
BUNDLE_POLICY
Attribute Type: {JSON}
Learn more about how ICE works in this article here.The list of available Peer connection bundle policies.
Keys:
-
MAX_COMPAT
{String}Value
"max-compat"
The value of the bundle policy to generate ICE candidates for each media type so each media type flows through different transports. -
MAX_BUNDLE
{String}Value
"max-bundle"
The value of the bundle policy to generate ICE candidates for one media type so all media type flows through a single transport. -
BALANCED
{String}Value
"balanced"
The value of the bundle policy to useMAX_BUNDLE
if Peer supports it, else fallback toMAX_COMPAT
. -
NONE
{String}Value
"none"
The value of the bundle policy to not use any media bundle. This removes thea=group:BUNDLE
line from session descriptions.
CANDIDATE_GENERATION_STATE
Attribute Type: {JSON}
Learn more about how ICE works in this article here.The list of Peer connection ICE gathering states.
Keys:
-
GATHERING
{String}Value
"gathering"
The value of the state when Peer connection is gathering ICE candidates. These ICE candidates are sent to Peer for its connection to check for a suitable matching pair of ICE candidates to establish an ICE connection for stream audio, video and data. SeeiceConnectionState
event for ICE connection status. This state cannot happen until Peer connection remote"offer"
/"answer"
session description is set. SeepeerConnectionState
event for session description exchanging status. -
COMPLETED
{String}Value
"completed"
The value of the state when Peer connection gathering of ICE candidates has completed.
CANDIDATE_PROCESSING_STATE
Attribute Type: {JSON}
Learn more about how ICE works in this article here.The list of Peer connection remote ICE candidate processing states for trickle ICE connections.
Keys:
-
RECEIVED
{String}Value
"received"
The value of the state when the remote ICE candidate was received. -
DROPPED
{String}Value
"received"
The value of the state when the remote ICE candidate is dropped. -
BUFFERED
{String}Value
"buffered"
The value of the state when the remote ICE candidate is buffered. -
PROCESSING
{String}Value
"processing"
The value of the state when the remote ICE candidate is being processed. -
PROCESS_SUCCESS
{String}Value
"processSuccess"
The value of the state when the remote ICE candidate has been processed successfully. The ICE candidate that is processed will be used to check against the list of locally generated ICE candidate to start matching for the suitable pair for the best ICE connection. -
PROCESS_ERROR
{String}Value
"processError"
The value of the state when the remote ICE candidate has failed to be processed.
DATA_CHANNEL_MESSAGE_ERROR
Attribute Type: {JSON}
The list of Datachannel sending message error types.
Keys:
-
MESSAGE
{String}Value
"message"
The value of the Datachannel sending message error type when encountered during sending P2P message fromsendP2PMessage()
method. -
TRANSFER
{String}Value
"transfer"
The value of the Datachannel sending message error type when encountered during data transfers fromsendURLData()
method orsendBlobData()
method.
DATA_CHANNEL_STATE
Attribute Type: {JSON}
The list of Datachannel connection states.
Keys:
-
CONNECTING
{String}Value
"connecting"
The value of the state when Datachannel is attempting to establish a connection. -
OPEN
{String}Value
"open"
The value of the state when Datachannel has established a connection. -
CLOSING
{String}Value
"closing"
The value of the state when Datachannel connection is closing. -
CLOSED
{String}Value
"closed"
The value of the state when Datachannel connection has closed. -
ERROR
{String}Value
"error"
The value of the state when Datachannel has encountered an exception during connection. -
CREATE_ERROR
{String}Value
"createError"
The value of the state when Datachannel has failed to establish a connection. -
BUFFERED_AMOUNT_LOW
{String}Value
"bufferedAmountLow"
The value of the state when Datachannel when the amount of data buffered to be sent falls below the Datachannel threshold. This state should occur only during aftersendBlobData()
method orsendURLData()
method orsendP2PMessage()
method. -
SEND_MESSAGE_ERROR
{String}Value
"sendMessageError"
The value of the state when Datachannel when data transfer packets or P2P message fails to send. This state should occur only during aftersendBlobData()
method orsendURLData()
method orsendP2PMessage()
method.
DATA_CHANNEL_TYPE
Attribute Type: {JSON}
The list of Datachannel types.
Keys:
-
MESSAGING
{String}Value
"messaging"
The value of the Datachannel type that is used only for messaging insendP2PMessage()
method. However for Peers that do not support simultaneous data transfers, this Datachannel type will be used to do data transfers (1 at a time). Each Peer connections will only have one of this Datachannel type and the connection will only close when the Peer connection is closed (happens whenpeerConnectionState
event triggers parameter payloadstate
asCLOSED
for Peer). -
DATA
{String}Value
"data"
The value of the Datachannel type that is used only for a data transfer insendURLData()
method andsendBlobData()
method. The connection will close after the data transfer has been completed or terminated (happens whendataTransferState
event triggers parameter payloadstate
asDOWNLOAD_COMPLETED
,UPLOAD_COMPLETED
,REJECTED
,CANCEL
orERROR
for Peer).
DATA_STREAM_STATE
Attribute Type: {JSON}
The list of data streaming states.
Keys:
-
SENDING_STARTED
{String}Value
"sendStart"
The value of the state when data streaming session has started from User to Peer. -
RECEIVING_STARTED
{String}Value
"receiveStart"
The value of the state when data streaming session has started from Peer to Peer. -
RECEIVED
{String}Value
"received"
The value of the state when data streaming session data chunk has been received from Peer to User. -
SENT
{String}Value
"sent"
The value of the state when data streaming session data chunk has been sent from User to Peer. -
SENDING_STOPPED
{String}Value
"sendStop"
The value of the state when data streaming session has stopped from User to Peer. -
RECEIVING_STOPPED
{String}Value
"receivingStop"
The value of the state when data streaming session has stopped from Peer to User. -
ERROR
{String}Value
"error"
The value of the state when data streaming session has errors. At this stage, the data streaming state is consideredSENDING_STOPPED
orRECEIVING_STOPPED
. -
START_ERROR
{String}Value
"startError"
The value of the state when data streaming session failed to start from User to Peer.
DATA_TRANSFER_DATA_TYPE
Attribute Type: {JSON}
The list of supported data transfer data types.
Keys:
-
BINARY_STRING
{String}Value
"binaryString"
The value of data transfer data type when Blob binary data chunks encoded to Base64 encoded string are sent or received over the Datachannel connection for the data transfer session. Used only insendBlobData()
method when parametersendChunksAsBinary
value isfalse
. -
ARRAY_BUFFER
{String}Value
"arrayBuffer"
The value of data transfer data type when ArrayBuffer binary data chunks are sent or received over the Datachannel connection for the data transfer session. Used only insendBlobData()
method when parametersendChunksAsBinary
value istrue
. -
BLOB
{String}Value
"blob"
The value of data transfer data type when Blob binary data chunks are sent or received over the Datachannel connection for the data transfer session. Used only insendBlobData()
method when parametersendChunksAsBinary
value istrue
. -
STRING
{String}Value
"string"
The value of data transfer data type when only string data chunks are sent or received over the Datachannel connection for the data transfer session. Used only insendURLData()
method.
DATA_TRANSFER_SESSION_TYPE
Attribute Type: {JSON}
The list of data transfers session types.
Keys:
-
BLOB
{String}Value
"blob"
The value of the session type forsendURLData()
method data transfer. -
DATA_URL
{String}Value
"dataURL"
The value of the session type formethod_sendBlobData()
method data transfer.
DATA_TRANSFER_STATE
Attribute Type: {JSON}
The list of data transfer states.
Keys:
-
UPLOAD_REQUEST
{String}Value
"request"
The value of the state when receiving an upload data transfer request from Peer to User. At this stage, the upload data transfer request from Peer may be accepted or rejected with theacceptDataTransfer()
method invoked by User. -
USER_UPLOAD_REQUEST
{String}Value
"userRequest"
The value of the state when User sent an upload data transfer request to Peer. At this stage, the upload data transfer request to Peer may be accepted or rejected with theacceptDataTransfer()
method invoked by Peer. -
UPLOAD_STARTED
{String}Value
"uploadStarted"
The value of the state when the data transfer request has been accepted and data transfer will start uploading data to Peer. At this stage, the data transfer may be terminated with thecancelDataTransfer()
method. -
DOWNLOAD_STARTED
{String}Value
"downloadStarted"
The value of the state when the data transfer request has been accepted and data transfer will start downloading data from Peer. At this stage, the data transfer may be terminated with thecancelDataTransfer()
method. -
REJECTED
{String}Value
"rejected"
The value of the state when upload data transfer request to Peer has been rejected and terminated. -
USER_REJECTED
{String}Value
"userRejected"
The value of the state when User rejected and terminated upload data transfer request from Peer. -
UPLOADING
{String}Value
"uploading"
The value of the state when data transfer is uploading data to Peer. -
DOWNLOADING
{String}Value
"downloading"
The value of the state when data transfer is downloading data from Peer. -
UPLOAD_COMPLETED
{String}Value
"uploadCompleted"
The value of the state when data transfer has uploaded successfully to Peer. -
DOWNLOAD_COMPLETED
{String}Value
"downloadCompleted"
The value of the state when data transfer has downloaded successfully from Peer. -
CANCEL
{String}Value
"cancel"
The value of the state when data transfer has been terminated from / to Peer. -
ERROR
{String}Value
"error"
The value of the state when data transfer has errors and has been terminated from / to Peer.
DATA_TRANSFER_TYPE
Attribute Type: {JSON}
The list of data transfers directions.
Keys:
-
UPLOAD
{String}Value
"upload"
The value of the data transfer direction when User is uploading data to Peer. -
DOWNLOAD
{String}Value
"download"
The value of the data transfer direction when User is downloading data from Peer.
DT_PROTOCOL_VERSION
Attribute Type: {String}
Note that this is used only for SDK developer purposes.The value of the current version of the data transfer protocol.
Current version:0.1.0
GET_CONNECTION_STATUS_STATE
Attribute Type: {JSON}
The list of getConnectionStatus()
method retrieval states.
Keys:
-
RETRIEVING
{Number}Value
0
The value of the state whengetConnectionStatus()
is retrieving the Peer connection stats. -
RETRIEVE_SUCCESS
{Number}Value
1
The value of the state whengetConnectionStatus()
has retrieved the Peer connection stats successfully. -
RETRIEVE_ERROR
{Number}Value
-1
The value of the state whengetConnectionStatus()
has failed retrieving the Peer connection stats.
GET_PEERS_STATE
Attribute Type: {JSON}
Note that this feature requiresThe list of"isPrivileged"
flag to be enabled for the App Key provided in theinit()
method, as only Users connecting using the App Key with this flag enabled (which we call privileged Users / Peers) can retrieve the list of Peer IDs from Rooms within the same App space. Read more about privileged App Key feature here.
getPeers()
method retrieval states.
Keys:
-
ENQUIRED
{String}Value
"enquired"
The value of the state whengetPeers()
is retrieving the list of Peer IDs from Rooms within the same App space from the Signaling server. -
RECEIVED
{String}Value
"received"
The value of the state whengetPeers()
has retrieved the list of Peer IDs from Rooms within the same App space from the Signaling server successfully.
HANDSHAKE_PROGRESS
Attribute Type: {JSON}
The list of Peer connection states.
Keys:
-
ENTER
{String}Value
"enter"
The value of the connection state when Peer has just entered the Room. At this stage,peerJoined
event is triggered. -
WELCOME
{String}Value
"welcome"
The value of the connection state when Peer is aware that User has entered the Room. At this stage,peerJoined
event is triggered and Peer connection may commence. -
OFFER
{String}Value
"offer"
The value of the connection state when Peer connection has set the local / remote"offer"
session description to start streaming connection. -
ANSWER
{String}Value
"answer"
The value of the connection state when Peer connection has set the local / remote"answer"
session description to establish streaming connection. -
ERROR
{String}Value
"error"
The value of the connection state when Peer connection has failed to establish streaming connection. This happens when there are errors that occurs in creating local"offer"
/"answer"
, or when setting remote / local"offer"
/"answer"
.
ICE_CONNECTION_STATE
Attribute Type: {JSON}
Learn more about how ICE works in this article here.The list of Peer connection ICE connection states.
Keys:
-
CHECKING
{String}Value
"checking"
The value of the state when Peer connection is checking for a suitable matching pair of ICE candidates to establish ICE connection. Exchanging of ICE candidates happens duringcandidateGenerationState
event. -
CONNECTED
{String}Value
"connected"
The value of the state when Peer connection has found a suitable matching pair of ICE candidates to establish ICE connection but is still checking for a better suitable matching pair of ICE candidates for the best ICE connectivity. At this state, ICE connection is already established and audio, video and data streaming has already started. -
COMPLETED
{String}Value
"completed"
The value of the state when Peer connection has found the best suitable matching pair of ICE candidates to establish ICE connection and checking has stopped. At this state, ICE connection is already established and audio, video and data streaming has already started. This may happpen afterCONNECTED
. -
FAILED
{String}Value
"failed"
The value of the state when Peer connection ICE connection has failed. -
DISCONNECTED
{String}Value
"disconnected"
The value of the state when Peer connection ICE connection is disconnected. At this state, the Peer connection may attempt to revive the ICE connection. This may happen due to flaky network conditions. -
CLOSED
{String}Value
"closed"
The value of the state when Peer connection ICE connection has closed. This happens when Peer connection is closed and no streaming can occur at this stage. -
TRICKLE_FAILED
{String}Value
"trickeFailed"
The value of the state when Peer connection ICE connection has failed during trickle ICE. Trickle ICE is enabled ininit()
methodenableIceTrickle
option.
INTRODUCE_STATE
Attribute Type: {}
Note that this feature requiresThe list of"isPrivileged"
flag to be enabled and"autoIntroduce"
flag to be disabled for the App Key provided in theinit()
method, as only Users connecting using the App Key with this flag enabled (which we call privileged Users / Peers) can retrieve the list of Peer IDs from Rooms within the same App space. Read more about privileged App Key feature here.
introducePeer
method Peer introduction request states.
Keys:
-
INTRODUCING
{String}Value
"enquired"
The value of the state when introduction request for the selected pair of Peers has been made to the Signaling server. -
ERROR
{String}Value
"error"
The value of the state when introduction request made to the Signaling server for the selected pair of Peers has failed.
isPrivileged
Attribute Type: {Boolean}
Stores the flag that indicates if "isPrivileged" is enabled.
If enabled, the User has Privileged features which has the ability to retrieve the list of
Peers in the same App space with getPeers()
method
and introduce Peers to each other with introducePeer
method.
Default value:
false
log
Attribute Type: {JSON}
Stores the logging functions.
Keys:
-
debug
{Function}The function that handles the DEBUG level logs.
-
log
{Function}The function that handles the LOG level logs.
-
info
{Function}The function that handles the INFO level logs.
-
warn
{Function}The function that handles the WARN level logs.
-
error
{Function}The function that handles the ERROR level logs.
LOG_LEVEL
Attribute Type: {JSON}
The list of the SDK console
API log levels.
Keys:
-
DEBUG
{Number}Value
4
The value of the log level that displaysconsole
debug
,log
,info
,warn
anderror
logs. -
LOG
{Number}Value
3
The value of the log level that displays onlyconsole
log
,info
,warn
anderror
logs. -
INFO
{Number}Value
2
The value of the log level that displays onlyconsole
info
,warn
anderror
logs. -
WARN
{Number}Value
1
The value of the log level that displays onlyconsole
warn
anderror
logs. -
ERROR
{Number}Value
0
The value of the log level that displays onlyconsole
error
logs. -
NONE
{Number}Value
-1
The value of the log level that displays no logs.
MEDIA_ACCESS_FALLBACK_STATE
Attribute Type: {}
The list of getUserMedia()
method or
shareScreen()
method Stream fallback states.
Keys:
-
FALLBACKING
{JSON}Value
0
The value of the state whengetUserMedia()
will retrieve audio track only when retrieving audio and video tracks failed. This can be configured byinit()
methodaudioFallback
option. -
FALLBACKED
{JSON}Value
1
The value of the state whengetUserMedia()
orshareScreen()
retrieves camera / screensharing Stream successfully but with missing originally required audio or video tracks. -
ERROR
{JSON}Value
-1
The value of the state whengetUserMedia()
failed to retrieve audio track only after retrieving audio and video tracks failed.
MEDIA_SOURCE
Attribute Type: {JSON}
The list of available screensharing media sources configured in the
shareScreen()
method.
Keys:
-
SCREEN
{String}Value
"screen"
The value of the option to share entire screen. -
WINDOW
{String}Value
"window"
The value of the option to share application windows. -
TAB
{String}Value
"tab"
The value of the option to share browser tab. Note that this is only supported by from Chrome 52+ and Opera 39+. -
TAB_AUDIO
{String}Value
"audio"
The value of the option to share browser tab audio. Note that this is only supported by Chrome 52+ and Opera 39+.options.audio
has to be enabled withTAB
also requested to enable sharing of tab audio. -
APPLICATION
{String}Value
"application"
The value of the option to share applications. Note that this is only supported by Firefox currently. -
BROWSER
{String}Value
"browser"
The value of the option to share browser. Note that this is only supported by Firefox currently, and requires toggling themedia.getUserMedia.browser.enabled
inabout:config
. -
CAMERA
{String}Value
"camera"
The value of the option to share camera. Note that this is only supported by Firefox currently.
PEER_CERTIFICATE
Attribute Type: {JSON}
Learn more about how ICE works in this article here.The list of available Peer connection certificates cryptographic algorithm to use.
Keys:
-
RSA
{String}Value
"RSA"
The value of the Peer connection certificate algorithm to use RSA-1024. -
ECDSA
{String}Value
"ECDSA"
The value of the Peer connection certificate algorithm to use ECDSA. -
AUTO
{String}Value
"AUTO"
The value of the Peer connection to use the default certificate generated.
PEER_CONNECTION_STATE
Attribute Type: {JSON}
Learn more about how ICE works in this article here.The list of Peer connection session description exchanging states.
Keys:
-
STABLE
{String}Value
"stable"
The value of the state when there is no session description being exchanged between Peer connection. -
HAVE_LOCAL_OFFER
{String}Value
"have-local-offer"
The value of the state when local"offer"
session description is set. This should transition toSTABLE
state after remote"answer"
session description is set. SeehandshakeProgress
event for a more detailed exchanging of session description states. -
HAVE_REMOTE_OFFER
{String}Value
"have-remote-offer"
The value of the state when remote"offer"
session description is set. This should transition toSTABLE
state after local"answer"
session description is set. SeehandshakeProgress
event for a more detailed exchanging of session description states. -
CLOSED
{String}Value
"closed"
The value of the state when Peer connection is closed and no session description can be exchanged and set.
PRIORITY_WEIGHT_SCHEME
Attribute Type: {JSON}
The list of User's priority weight schemes for
joinRoom()
method connections.
Keys:
-
ENFORCE_OFFERER
{String}Value
"enforceOfferer"
The value of the priority weight scheme to enforce User as the offerer. -
ENFORCE_ANSWERER
{String}Value
"enforceAnswerer"
The value of the priority weight scheme to enforce User as the answerer. -
AUTO
{String}Value
"auto"
The value of the priority weight scheme to let User be offerer or answerer based on Signaling server selection.
READY_STATE_CHANGE
Attribute Type: {JSON}
The list of init()
method ready states.
Keys:
-
INIT
{Number}Value
0
The value of the state wheninit()
has just started. -
LOADING
{Number}Value
1
The value of the state wheninit()
is authenticating App Key provided (and with credentials if provided as well) with the Auth server. -
COMPLETED
{Number}Value
2
The value of the state wheninit()
has successfully authenticated with the Auth server. Room session token is generated for joining thedefaultRoom
provided ininit()
. Room session token has to be generated each time User switches to a different Room injoinRoom()
method. -
ERROR
{Number}Value
-1
The value of the state wheninit()
has failed authenticating with the Auth server. [Rel: Skylink.READY_STATE_CHANGE_ERROR]
READY_STATE_CHANGE_ERROR
Attribute Type: {JSON}
The list of init()
method ready state failure codes.
Keys:
-
API_INVALID
{Number}Value
4001
The value of the failure code when provided App Key ininit()
does not exists. To resolve this, check that the provided App Key exists in the Temasys Console. -
API_DOMAIN_NOT_MATCH
{Number}Value
4002
The value of the failure code when"domainName"
property in the App Key does not match the accessing server IP address. To resolve this, contact our support portal. -
API_CORS_DOMAIN_NOT_MATCH
{Number}Value
4003
The value of the failure code when"corsurl"
property in the App Key does not match accessing CORS. To resolve this, configure the App Key CORS in the Temasys Console. -
API_CREDENTIALS_INVALID
{Number}Value
4004
The value of the failure code when there is no CORS present in the HTTP headers during the request to the Auth server present noroptions.credentials.credentials
configuration provided in theinit()
. To resolve this, ensure that CORS are present in the HTTP headers during the request to the Auth server. -
API_CREDENTIALS_NOT_MATCH
{Number}Value
4005
The value of the failure code when theoptions.credentials.credentials
configuration provided in theinit()
does not match up with theoptions.credentials.startDateTime
,options.credentials.duration
or that the"secret"
used to generateoptions.credentials.credentials
does not match the App Key's"secret
property provided. To resolve this, check that theoptions.credentials.credentials
is generated correctly and that the"secret"
used to generate it is from the App Key provided in theinit()
. -
API_INVALID_PARENT_KEY
{Number}Value
4006
The value of the failure code when the App Key provided does not belong to any existing App. To resolve this, check that the provided App Key exists in the Developer Console. -
API_NO_MEETING_RECORD_FOUND
{Number}Value
4010
The value of the failure code when providedoptions.credentials
does not match any scheduled meetings available for the "Persistent Room" enabled App Key provided. See the Persistent Room article to learn more. -
API_OVER_SEAT_LIMIT
{Number}Value
4020
The value of the failure code when App Key has reached its current concurrent users limit. To resolve this, use another App Key. To create App Keys dynamically, see the Application REST API docs for more information. -
API_RETRIEVAL_FAILED
{Number}Value
4021
The value of the failure code when App Key retrieval of authentication token fails. If this happens frequently, contact our support portal. -
API_WRONG_ACCESS_DOMAIN
{Number}Value
5005
The value of the failure code when App Key makes request to the incorrect Auth server. To resolve this, ensure that theroomServer
is not configured. If this persists even withoutroomServer
configuration, contact our support portal. -
XML_HTTP_REQUEST_ERROR
{Number}Value
-1
The value of the failure code when requesting to Auth server has timed out. -
XML_HTTP_NO_REPONSE_ERROR
{Number}Value
-2
The value of the failure code when response from Auth server is empty or timed out. -
NO_SOCKET_IO
{Number}Value
1
The value of the failure code when dependency Socket.IO client is not loaded. To resolve this, ensure that the Socket.IO client dependency is loaded before the Skylink SDK. You may use the provided Socket.IO client CDN here. -
NO_XMLHTTPREQUEST_SUPPORT
{Number}Value
2
The value of the failure code when XMLHttpRequest API required to make request to Auth server is not supported. To resolve this, display in the Web UI to ask clients to switch to the list of supported browser as listed in here. -
NO_WEBRTC_SUPPORT
{Number}Value
3
The value of the failure code when RTCPeerConnection API required for Peer connections is not supported. To resolve this, display in the Web UI to ask clients to switch to the list of supported browser as listed in here. For plugin supported browsers, if the clients does not have the plugin installed, there will be an installation toolbar that will prompt for installation to support the RTCPeerConnection API. -
NO_PATH
{Number}Value
4
The value of the failure code when providedinit()
configuration has errors. -
ADAPTER_NO_LOADED
{Number} -
PARSE_CODECS
{Number}Value
8
The value of the failure code when codecs support cannot be parsed and retrieved.
RECORDING_STATE
Attribute Type: {JSON}
The list of recording states.
Keys:
-
START
{Number}Value
0
The value of the state when recording session has started. -
STOP
{Number}Value
1
The value of the state when recording session has stopped.
At this stage, the recorded videos will go through the mixin server to compile the videos. -
LINK
{Number}Value
2
The value of the state when recording session mixin request has been completed. -
ERROR
{Number}Value
-1
The value of the state state when recording session has errors. This can happen during recording session or during mixin of recording videos, and at this stage, any current recording session or mixin is aborted.
REGIONAL_SERVER
Attribute Type: {JSON}
Spoofs the REGIONAL_SERVER to prevent errors on deployed apps except the fact this no longer works. Automatic regional selection has already been implemented hence REGIONAL_SERVER is no longer useful.
RTCP_MUX_POLICY
Attribute Type: {JSON}
Learn more about how ICE works in this article here.The list of available Peer connection RTCP mux policies.
Keys:
-
REQUIRE
{String}Value
"require"
The value of the RTCP mux policy to generate ICE candidates for RTP only and RTCP shares the same ICE candidates. -
NEGOTIATE
{String}Value
"negotiate"
The value of the RTCP mux policy to generate ICE candidates for both RTP and RTCP each.
RTMP_STATE
Attribute Type: {JSON}
The list of RTMP states.
Keys:
-
START
{Number}Value
0
The value of the state when live streaming session has started. -
STOP
{Number}Value
1
The value of the state when live streaming session has stopped.
At this stage, the recorded videos will go through the mixin server to compile the videos. -
ERROR
{Number}Value
-1
The value of the state state when live streaming session has errors.
SERVER_PEER_TYPE
Attribute Type: {JSON}
As there are more features getting implemented, there will be eventually more different types of server Peers.The list of available types of server Peer connections.
Keys:
-
MCU
{String}Value
"mcu"
The value of the server Peer type that is used for MCU connection.
SM_PROTOCOL_VERSION
Attribute Type: {String}
Note that this is used only for SDK developer purposes.The value of the current version of the Signaling socket message protocol.
Current version:0.1.4
SOCKET_ERROR
Attribute Type: {JSON}
The list of joinRoom()
method socket connection failure states.
Keys:
-
CONNECTION_FAILED
{Number}Value
0
The value of the failure state whenjoinRoom()
socket connection failed to establish with the Signaling server at the first attempt. -
RECONNECTION_FAILED
{Number}Value
-1
The value of the failure state whenjoinRoom()
socket connection failed to establish the Signaling server after the first attempt. -
CONNECTION_ABORTED
{Number}Value
-2
The value of the failure state whenjoinRoom()
socket connection will not attempt to reconnect after the failure of the first attempt inCONNECTION_FAILED
as there are no more ports or transports to attempt for reconnection. -
RECONNECTION_ABORTED
{Number}Value
-3
The value of the failure state whenjoinRoom()
socket connection will not attempt to reconnect after the failure of several attempts inRECONNECTION_FAILED
as there are no more ports or transports to attempt for reconnection. -
RECONNECTION_ATTEMPT
{Number}Value
-4
The value of the failure state whenjoinRoom()
socket connection is attempting to reconnect with a new port or transport after the failure of attempts inCONNECTION_FAILED
orRECONNECTED_FAILED
.
SOCKET_FALLBACK
Attribute Type: {JSON}
The list of joinRoom()
method socket connection reconnection states.
Keys:
-
NON_FALLBACK
{String}Value
"nonfallback"
The value of the reconnection state whenjoinRoom()
socket connection is at its initial state without transitioning to any new socket port or transports yet. -
FALLBACK_PORT
{String}Value
"fallbackPortNonSSL"
The value of the reconnection state whenjoinRoom()
socket connection is reconnecting with another new HTTP port using WebSocket transports to attempt to establish connection with Signaling server. -
FALLBACK_PORT_SSL
{String}Value
"fallbackPortSSL"
The value of the reconnection state whenjoinRoom()
socket connection is reconnecting with another new HTTPS port using WebSocket transports to attempt to establish connection with Signaling server. -
LONG_POLLING
{String}Value
"fallbackLongPollingNonSSL"
The value of the reconnection state whenjoinRoom()
socket connection is reconnecting with another new HTTP port using Polling transports to attempt to establish connection with Signaling server. -
LONG_POLLING_SSL
{String}Value
"fallbackLongPollingSSL"
The value of the reconnection state whenjoinRoom()
socket connection is reconnecting with another new HTTPS port using Polling transports to attempt to establish connection with Signaling server.
STATS_API_VERSION
Attribute Type: {String}
Note that this is used only for SDK development purposes.The value of the current version of the stats API used.
Current version:1.1
SYSTEM_ACTION
Attribute Type: {JSON}
The list of Signaling server reaction states during joinRoom()
method.
Keys:
-
WARNING
{String}Value
"warning"
The value of the state when Room session is about to end. -
REJECT
{String}Value
"reject"
The value of the state when Room session has failed to start or has ended.
SYSTEM_ACTION_REASON
Attribute Type: {JSON}
The list of Signaling server reaction states reason of action code during
joinRoom()
method.
Keys:
-
CREDENTIALS_EXPIRED
{String}Value
"oldTimeStamp"
The value of the reason code when Room session token has expired. Happens duringjoinRoom()
method request. Results with:REJECT
-
CREDENTIALS_ERROR
{String}Value
"credentialError"
The value of the reason code when Room session token provided is invalid. Happens duringjoinRoom()
method request. -
DUPLICATED_LOGIN
{String}Value
"duplicatedLogin"
The value of the reason code when Room session token has been used already. Happens duringjoinRoom()
method request. Results with:REJECT
-
ROOM_NOT_STARTED
{String}Value
"notStart"
The value of the reason code when Room session has not started. Happens duringjoinRoom()
method request. Results with:REJECT
-
EXPIRED
{String}Value
"expired"
The value of the reason code when Room session has ended already. Happens duringjoinRoom()
method request. Results with:REJECT
-
ROOM_LOCKED
{String}Value
"locked"
The value of the reason code when Room is locked. Happens duringjoinRoom()
method request. Results with:REJECT
-
FAST_MESSAGE
{String}Value
"fastmsg"
The value of the reason code when User is flooding socket messages to the Signaling server that is sent too quickly within less than a second interval. Happens after Room session has started. This can be caused by various methods likesendMessage()
method,setUserData()
method,muteStream()
method,enableAudio()
method,enableVideo()
method,disableAudio()
method anddisableVideo()
method Results with:WARNING
-
ROOM_CLOSING
{String}Value
"toClose"
The value of the reason code when Room session is ending. Happens after Room session has started. This serves as a prerequisite warning beforeROOM_CLOSED
occurs. Results with:WARNING
-
ROOM_CLOSED
{String}Value
"roomclose"
The value of the reason code when Room session has just ended. Happens after Room session has started. Results with:REJECT
-
SERVER_ERROR
{String}Value
"serverError"
The value of the reason code when Room session fails to start due to some technical errors. Happens duringjoinRoom()
method request. Results with:REJECT
-
KEY_ERROR
{String}Value
"keyFailed"
The value of the reason code when Room session fails to start due to some technical error pertaining to App Key initialization. Happens duringjoinRoom()
method request. Results with:REJECT
TURN_TRANSPORT
Attribute Type: {JSON}
Note that configuring the protocol may not necessarily result in the desired network transports protocol
used in the actual TURN network traffic as it depends which protocol the browser selects and connects with.
This simply configures the TURN ICE server urls query option when constructing
the Peer connection. When all protocols are selected, the ICE servers urls are duplicated with all protocols.
The list of TURN network transport protocols options when constructing Peer connections
configured in the init()
method.
Example .urls
inital input: ["turn:server.com?transport=tcp"
,
"turn:server1.com:3478"
, "turn:server.com?transport=udp"
]
Keys:
-
TCP
{String}Value
"tcp"
The value of the option to configure using only TCP network transport protocol. Example.urls
output: ["turn:server.com?transport=tcp"
,"turn:server1.com:3478?transport=tcp"
] -
UDP
{String}Value
"udp"
The value of the option to configure using only UDP network transport protocol. Example.urls
output: ["turn:server.com?transport=udp"
,"turn:server1.com:3478?transport=udp"
] -
ANY
{String}Value
"any"
The value of the option to configure using any network transport protocols configured from the Signaling server. Example.urls
output: ["turn:server.com?transport=tcp"
,"turn:server1.com:3478"
,"turn:server.com?transport=udp"
] -
NONE
{String}Value
"none"
The value of the option to not configure using any network transport protocols. Example.urls
output: ["turn:server.com"
,"turn:server1.com:3478"
] Configuring this does not mean that no protocols will be used, but rather removing?transport=(protocol)
query option in the TURN ICE server.urls
when constructing the Peer connection. -
ALL
{String}Value
"all"
The value of the option to configure using both TCP and UDP network transport protocols. Example.urls
output: ["turn:server.com?transport=tcp"
,"turn:server.com?transport=udp"
,"turn:server1.com:3478?transport=tcp"
,"turn:server1.com:3478?transport=udp"
]
VIDEO_CODEC
Attribute Type: {JSON}
Note that if the video codec is not supported, the SDK will not configure the localThe list of available video codecs to set as the preferred video codec to use to encode sending video data when available encoded video codec for Peer connections configured in the"offer"
or"answer"
session description to prefer the codec.
init()
method.
Keys:
-
AUTO
{String}Value
"auto"
The value of the option to not prefer any video codec but rather use the created local"offer"
/"answer"
session description video codec preference. -
VP8
{String}Value
"VP8"
The value of the option to prefer the VP8 video codec. -
VP9
{String}Value
"VP9"
The value of the option to prefer the VP9 video codec. -
H264
{String}Value
"H264"
The value of the option to prefer the H264 video codec.
VIDEO_QUALITY
Attribute Type: {JSON}
The options available for video and audio bitrates (kbps) quality.
Keys:
-
HD
{JSON}Value
{ video: 3200, audio: 80 }
The value of option to prefer high definition video and audio bitrates. -
HQ
{JSON}Value
{ video: 1200, audio: 50 }
The value of option to prefer high quality video and audio bitrates. -
SQ
{JSON}Value
{ video: 800, audio: 30 }
The value of option to prefer standard quality video and audio bitrates. -
LQ
{JSON}Value
{ video: 500, audio: 20 }
The value of option to prefer low quality video and audio bitrates.
VIDEO_RESOLUTION
Attribute Type: {JSON}
Note that currently getUserMedia()
method only configures
the maximum resolution of the Stream due to browser interopability and support.
The list of
video resolutions sets configured in the getUserMedia()
method.
Keys:
-
QQVGA
{JSON}Value
{ width: 160, height: 120 }
The value of the option to configure QQVGA resolution. Aspect ratio:4:3
Note that configurating this resolution may not be supported depending on browser and device supports. -
HQVGA
{JSON}Value
{ width: 240, height: 160 }
The value of the option to configure HQVGA resolution. Aspect ratio:3:2
Note that configurating this resolution may not be supported depending on browser and device supports. -
QVGA
{JSON}Value
{ width: 320, height: 240 }
The value of the option to configure QVGA resolution. Aspect ratio:4:3
-
WQVGA
{JSON}Value
{ width: 384, height: 240 }
The value of the option to configure WQVGA resolution. Aspect ratio:16:10
Note that configurating this resolution may not be supported depending on browser and device supports. -
HVGA
{JSON}Value
{ width: 480, height: 320 }
The value of the option to configure HVGA resolution. Aspect ratio:3:2
Note that configurating this resolution may not be supported depending on browser and device supports. -
VGA
{JSON}Value
{ width: 640, height: 480 }
The value of the option to configure VGA resolution. Aspect ratio:4:3
-
WVGA
{JSON}Value
{ width: 768, height: 480 }
The value of the option to configure WVGA resolution. Aspect ratio:16:10
Note that configurating this resolution may not be supported depending on browser and device supports. -
FWVGA
{JSON}Value
{ width: 854, height: 480 }
The value of the option to configure FWVGA resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on browser and device supports. -
SVGA
{JSON}Value
{ width: 800, height: 600 }
The value of the option to configure SVGA resolution. Aspect ratio:4:3
Note that configurating this resolution may not be supported depending on browser and device supports. -
DVGA
{JSON}Value
{ width: 960, height: 640 }
The value of the option to configure DVGA resolution. Aspect ratio:3:2
Note that configurating this resolution may not be supported depending on browser and device supports. -
WSVGA
{JSON}Value
{ width: 1024, height: 576 }
The value of the option to configure WSVGA resolution. Aspect ratio:16:9
-
HD
{JSON}Value
{ width: 1280, height: 720 }
The value of the option to configure HD resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on device supports. -
HDPLUS
{JSON}Value
{ width: 1600, height: 900 }
The value of the option to configure HDPLUS resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on browser and device supports. -
FHD
{JSON}Value
{ width: 1920, height: 1080 }
The value of the option to configure FHD resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on device supports. -
QHD
{JSON}Value
{ width: 2560, height: 1440 }
The value of the option to configure QHD resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on browser and device supports. -
WQXGAPLUS
{JSON}Value
{ width: 3200, height: 1800 }
The value of the option to configure WQXGAPLUS resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on browser and device supports. -
UHD
{JSON}Value
{ width: 3840, height: 2160 }
The value of the option to configure UHD resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on browser and device supports. -
UHDPLUS
{JSON}Value
{ width: 5120, height: 2880 }
The value of the option to configure UHDPLUS resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on browser and device supports. -
FUHD
{JSON}Value
{ width: 7680, height: 4320 }
The value of the option to configure FUHD resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on browser and device supports. -
QUHD
{JSON}Value
{ width: 15360, height: 8640 }
The value of the option to configure QUHD resolution. Aspect ratio:16:9
Note that configurating this resolution may not be supported depending on browser and device supports.
candidateGenerationState
Learn more about how ICE works in this article here.Event triggered when a Peer connection ICE gathering state has changed.
Event Payload:
-
state
{String}The current Peer connection ICE gathering state. [Rel: Skylink.CANDIDATE_GENERATION_STATE]
-
peerId
{String}The Peer ID.
candidateProcessingState
Learn more about how ICE works in this article here.Event triggered when remote ICE candidate processing state has changed when Peer is using trickle ICE.
Note that this event may not be triggered for MCU enabled Peer connections as ICE candidates may be received in the session description instead.
Event Payload:
-
state
{String}The ICE candidate processing state. [Rel: Skylink.CANDIDATE_PROCESSING_STATE]
-
peerId
{String}The Peer ID.
-
candidateId
{String}The remote ICE candidate session ID. Note that this value is not related to WebRTC API but for identification of remote ICE candidate received.
-
candidateType
{String}The remote ICE candidate type. Expected values are
"host"
(local network),"srflx"
(STUN) and"relay"
(TURN). -
candidate
{JSON}The remote ICE candidate.
-
candidate
{String}The remote ICE candidate connection description.
-
sdpMid
{String}The remote ICE candidate identifier based on the remote session description.
-
sdpMLineIndex
{Number}The remote ICE candidate media description index (starting from
0
) based on the remote session description.
-
-
error
{Error} OptionalThe error object. Defined only when
state
isDROPPED
orPROCESS_ERROR
.
candidatesGathered
Learn more about how ICE works in this article here.Event triggered when all remote ICE candidates gathering has completed and been processed.
Note that this event may not be triggered for MCU enabled Peer connections as ICE candidates may be received in the session description instead.
Event Payload:
-
peerId
{String}The Peer ID.
-
length
{JSON}The remote ICE candidates length.
-
expected
{Number}The expected total number of remote ICE candidates to be received.
-
received
{Number}The actual total number of remote ICE candidates received.
-
processed
{Number}The total number of remote ICE candidates processed.
-
channelClose
Event triggered when socket connection to Signaling server has closed.
Event Payload:
-
session
{JSON}The socket connection session information. Object signature matches the
session
parameter payload received in thechannelOpen
event.
channelError
This may be caused by Javascript errors in the event listener when subscribing to events.Event triggered when socket connection encountered exception.
It may be resolved by checking for code errors in your Web App in the event subscribing listener.
skylinkDemo.on("eventName", function () { // Errors here });
Event Payload:
-
error
{Error | String}The error object.
-
session
{JSON}The socket connection session information. Object signature matches the
session
parameter payload received in thechannelOpen
event.
channelMessage
Note that this is used only for SDK developer purposes.Event triggered when receiving socket message from the Signaling server.
Event Payload:
-
message
{JSON}The socket message object.
-
session
{JSON}The socket connection session information. Object signature matches the
session
parameter payload received in thechannelOpen
event.
channelOpen
Event triggered when socket connection to Signaling server has opened.
Event Payload:
-
session
{JSON}The socket connection session information.
-
serverUrl
{String}The socket connection Signaling url used.
-
transportType
{String}The socket connection transport type used.
-
socketOptions
{JSON}The socket connection options.
-
attempts
{Number}The socket connection current reconnection attempts.
-
finalAttempts
{Number}The socket connection current last attempts for the last available transports and port.
-
channelRetry
Event triggered when attempting to establish socket connection to Signaling server when failed.
Event Payload:
-
fallbackType
{String}The current fallback state. [Rel: Skylink.SOCKET_FALLBACK]
-
currentAttempt
{Number}The current socket reconnection attempt.
-
session
{JSON}The socket connection session information. Object signature matches the
session
parameter payload received in thechannelOpen
event.
dataChannelState
Event triggered when a Datachannel connection state has changed.
Event Payload:
-
state
{String}The current Datachannel connection state. [Rel: Skylink.DATA_CHANNEL_STATE]
-
peerId
{String}The Peer ID.
-
error
{Error} OptionalThe error object. Defined only when
state
payload isERROR
orSEND_MESSAGE_ERROR
. -
channelName
{String}The Datachannel ID.
-
channelType
{String}The Datachannel type. [Rel: Skylink.DATA_CHANNEL_TYPE]
-
messageType
{String}The Datachannel sending Datachannel message error type. Defined only when
state payload is [Rel: Skylink.DATA_CHANNEL_MESSAGE_ERROR]SEND_MESSAGE_ERROR
. -
bufferAmount
{JSON}The Datachannel buffered amount information.
-
bufferedAmountLow
{Number}The size of currently queued data to send on the Datachannel connection.
-
bufferedAmountLowThreshold
{Number}The current buffered amount low threshold configured.
-
dataStreamState
Event triggered when a data streaming state has changed.
Event Payload:
-
state
{String}The current data streaming state. [Rel: Skylink.DATA_STREAM_STATE]
-
streamId
{String}The data streaming session ID. Note that this is defined as
null
whenstate
payload isSTART_ERROR
. -
peerId
{String}The Peer ID. Note that this could be defined as
null
whenstate
payload isSTART_ERROR
and there is no Peers to start data streaming with. -
streamInfo
{JSON}The data streaming information.
-
chunk
{Blob | String} OptionalThe data chunk received. Defined only when
state
payload isRECEIVED
orSENT
. -
chunkSize
{Number}The data streaming data chunk size received.
-
chunkType
{String}The data streaming data chunk type received. The initial data chunks value may change depending on the currently received data chunk type or the agent supported sending type of data chunks. [Rel: Skylink.DATA_TRANSFER_DATA_TYPE]
-
isStringStream
{String}The flag if data streaming data chunks are strings.
-
isPrivate
{Boolean}The flag if data streaming is targeted or not, basing off the
targetPeerId
parameter being defined instartStreamingData()
method. -
senderPeerId
{String}The sender Peer ID.
-
-
error
{Error} OptionalThe error object. Defined only when
state
payload isERROR
orSTART_ERROR
,.
dataTransferState
Event triggered when a data transfer state has changed.
Event Payload:
-
state
{String}The current data transfer state. [Rel: Skylink.DATA_TRANSFER_STATE]
-
transferId
{String}The data transfer ID. Note that this is defined as
null
whenstate
payload isSTART_ERROR
. -
peerId
{String}The Peer ID. Note that this could be defined as
null
whenstate
payload isSTART_ERROR
and there is no Peers to start data transfer with. -
transferInfo
{JSON}The data transfer information.
-
data
{Blob | String} OptionalThe data object. Defined only when
state
payload isUPLOAD_STARTED
orDOWNLOAD_COMPLETED
. -
name
{String}The data transfer name.
-
size
{Number}The data transfer data object size.
-
dataType
{String}The data transfer session type. [Rel: Skylink.DATA_TRANSFER_SESSION_TYPE]
-
chunkType
{String}The data transfer type of data chunk being used to send to Peer for transfers. For
sendBlobData()
method data transfers, the initial data chunks value may change depending on the currently received data chunk type or the agent supported sending type of data chunks. ForsendURLData()
method data transfers, it isSTRING
always. [Rel: Skylink.DATA_TRANSFER_DATA_TYPE] -
mimeType
{String} OptionalThe data transfer data object MIME type. Defined only when
sendBlobData()
method data object sent MIME type information is defined. -
chunkSize
{Number}The data transfer data chunk size.
-
percentage
{Number}The data transfer percentage of completion progress.
-
timeout
{Number}The flag if data transfer is targeted or not, basing off the
targetPeerId
parameter being defined insendURLData()
method orsendBlobData()
method. -
isPrivate
{Boolean}The flag if message is targeted or not, basing off the
targetPeerId
parameter being defined insendBlobData()
method orsendURLData()
method. -
direction
{String}The data transfer direction. [Rel: Skylink.DATA_TRANSFER_TYPE]
-
-
error
{JSON} OptionalThe error result. Defined only when
state
payload isERROR
,CANCEL
,REJECTED
,START_ERROR
orUSER_REJECTED
.-
message
{Error | String}The error object.
-
transferType
{String}The data transfer direction from where the error occurred. [Rel: Skylink.DATA_TRANSFER_TYPE]
-
getConnectionStatusStateChange
Event triggered when getConnectionStatus()
method
retrieval state changes.
Event Payload:
-
state
{Number}The current
getConnectionStatus()
retrieval state. [Rel: Skylink.GET_CONNECTION_STATUS_STATE] -
peerId
{String}The Peer ID.
-
stats
{JSON} OptionalThe Peer connection current stats. Defined only when
state
payload isRETRIEVE_SUCCESS
.-
raw
{JSON}The Peer connection raw stats before parsing.
-
audio
{JSON}The Peer connection audio streaming stats.
-
sending
{JSON}The Peer connection sending audio streaming stats. -
sending.bytes
{Number}The Peer connection current sending audio streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps. -
sending.totalBytes
{Number}The Peer connection total sending audio streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps. -
sending.packets
{Number}The Peer connection current sending audio streaming packets. -
sending.totalPackets
{Number}The Peer connection total sending audio streaming packets. -
sending.packetsLost
{Number}This property has been deprecated and would be removed in future releases as it should not be in
The Peer connection current sending audio streaming packets lost.sending
property. -
sending.totalPacketsLost
{Number}This property has been deprecated and would be removed in future releases as it should not be in
The Peer connection total sending audio streaming packets lost.sending
property. -
sending.ssrc
{Number}The Peer connection sending audio streaming RTP packets SSRC. -
sending.rtt
{Number}The Peer connection sending audio streaming RTT (Round-trip delay time). Defined as0
if it's not present in original raw stats before parsing. -
sending.jitter
{Number}This property has been deprecated and would be removed in future releases as it should not be in
The Peer connection sending audio streaming RTP packets jitter in seconds. Defined assending
property.0
if it's not present in original raw stats before parsing. -
sending.jitterBufferMs
{Number} OptionalThis property has been deprecated and would be removed in future releases as it should not be in
The Peer connection sending audio streaming RTP packets jitter buffer in miliseconds. Defined assending
property.null
if it's not available in original raw stats before parsing. -
sending.codec
{JSON} OptionalThe Peer connection sending audio streaming selected codec information. Defined asnull
if local session description is not available before parsing. -
sending.codec.name
{String}The Peer connection sending audio streaming selected codec name. -
sending.codec.payloadType
{Number}The Peer connection sending audio streaming selected codec payload type. -
sending.codec.implementation
{String} OptionalThe Peer connection sending audio streaming selected codec implementation. Defined asnull
if it's not available in original raw stats before parsing. -
sending.codec.channels
{Number} OptionalThe Peer connection sending audio streaming selected codec channels (2 for stereo). Defined asnull
if it's not available in original raw stats before parsing, and this is usually present instats.audio
property. -
sending.codec.clockRate
{Number} OptionalThe Peer connection sending audio streaming selected codec media sampling rate. Defined asnull
if it's not available in original raw stats before parsing. -
sending.codec.params
{String} OptionalThe Peer connection sending audio streaming selected codec parameters. Defined asnull
if it's not available in original raw stats before parsing. -
sending.inputLevel
{Number} OptionalThe Peer connection sending audio streaming input level. Defined asnull
if it's not available in original raw stats before parsing. -
sending.echoReturnLoss
{Number} OptionalThe Peer connection sending audio streaming echo return loss in db (decibels). Defined asnull
if it's not available in original raw stats before parsing. -
sending.echoReturnLossEnhancement
{Number} OptionalThe Peer connection sending audio streaming echo return loss enhancement db (decibels). Defined asnull
if it's not available in original raw stats before parsing. -
receiving
{JSON}The Peer connection receiving audio streaming stats. -
receiving.bytes
{Number}The Peer connection current sending audio streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps. -
receiving.totalBytes
{Number}The Peer connection total sending audio streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps. -
receiving.packets
{Number}The Peer connection current receiving audio streaming packets. -
receiving.totalPackets
{Number}The Peer connection total receiving audio streaming packets. -
receiving.packetsLost
{Number}The Peer connection current receiving audio streaming packets lost. -
receiving.fractionLost
{Number}The Peer connection current receiving audio streaming fraction packets lost. -
receiving.packetsDiscarded
{Number}The Peer connection current receiving audio streaming packets discarded. -
receiving.totalPacketsLost
{Number}The Peer connection total receiving audio streaming packets lost. -
receiving.totalPacketsDiscarded
{Number}The Peer connection total receiving audio streaming packets discarded. -
receiving.ssrc
{Number}The Peer connection receiving audio streaming RTP packets SSRC. -
receiving.jitter
{Number}The Peer connection receiving audio streaming RTP packets jitter in seconds. Defined as0
if it's not present in original raw stats before parsing. -
receiving.jitterBufferMs
{Number} OptionalThe Peer connection receiving audio streaming RTP packets jitter buffer in miliseconds. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.codec
{JSON} OptionalThe Peer connection receiving audio streaming selected codec information. Defined asnull
if remote session description is not available before parsing. Note that if the value is polyfilled, the value may not be accurate since the remote Peer can override the selected codec. The value is derived from the remote session description. -
receiving.codec.name
{String}The Peer connection receiving audio streaming selected codec name. -
receiving.codec.payloadType
{Number}The Peer connection receiving audio streaming selected codec payload type. -
receiving.codec.implementation
{String} OptionalThe Peer connection receiving audio streaming selected codec implementation. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.codec.channels
{Number} OptionalThe Peer connection receiving audio streaming selected codec channels (2 for stereo). Defined asnull
if it's not available in original raw stats before parsing, and this is usually present instats.audio
property. -
receiving.codec.clockRate
{Number} OptionalThe Peer connection receiving audio streaming selected codec media sampling rate. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.codec.params
{String} OptionalThe Peer connection receiving audio streaming selected codec parameters. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.outputLevel
{Number} OptionalThe Peer connection receiving audio streaming output level. Defined asnull
if it's not available in original raw stats before parsing.
-
-
video
{JSON}The Peer connection video streaming stats.
-
sending
{JSON}The Peer connection sending video streaming stats. -
sending.bytes
{Number}The Peer connection current sending video streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps. -
sending.totalBytes
{Number}The Peer connection total sending video streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps. -
sending.packets
{Number}The Peer connection current sending video streaming packets. -
sending.totalPackets
{Number}The Peer connection total sending video streaming packets. -
sending.packetsLost
{Number}This property has been deprecated and would be removed in future releases as it should not be in
The Peer connection current sending video streaming packets lost.sending
property. -
sending.totalPacketsLost
{Number}This property has been deprecated and would be removed in future releases as it should not be in
The Peer connection total sending video streaming packets lost.sending
property. -
sending.ssrc
{Number}The Peer connection sending video streaming RTP packets SSRC. -
sending.rtt
{Number}The Peer connection sending video streaming RTT (Round-trip delay time). Defined as0
if it's not present in original raw stats before parsing. -
sending.jitter
{Number}This property has been deprecated and would be removed in future releases as it should not be in
The Peer connection sending video streaming RTP packets jitter in seconds. Defined assending
property.0
if it's not present in original raw stats before parsing. -
sending.jitterBufferMs
{Number} OptionalThis property has been deprecated and would be removed in future releases as it should not be in
The Peer connection sending video streaming RTP packets jitter buffer in miliseconds. Defined assending
property.null
if it's not available in original raw stats before parsing. -
sending.qpSum
{Number} OptionalThe Peer connection sending video streaming sum of the QP values of frames passed. Defined asnull
if it's not available in original raw stats before parsing. -
sending.codec
{JSON} OptionalThe Peer connection sending video streaming selected codec information. Defined asnull
if local session description is not available before parsing. -
sending.codec.name
{String}The Peer connection sending video streaming selected codec name. -
sending.codec.payloadType
{Number}The Peer connection sending video streaming selected codec payload type. -
sending.codec.implementation
{String} OptionalThe Peer connection sending video streaming selected codec implementation. Defined asnull
if it's not available in original raw stats before parsing. -
sending.codec.channels
{Number} OptionalThe Peer connection sending video streaming selected codec channels (2 for stereo). Defined asnull
if it's not available in original raw stats before parsing, and this is usually present instats.audio
property. -
sending.codec.clockRate
{Number} OptionalThe Peer connection sending video streaming selected codec media sampling rate. Defined asnull
if it's not available in original raw stats before parsing. -
sending.codec.params
{String} OptionalThe Peer connection sending video streaming selected codec parameters. Defined asnull
if it's not available in original raw stats before parsing. -
sending.frames
{Number} OptionalThe Peer connection sending video streaming frames. Defined asnull
if it's not available in original raw stats before parsing. -
sending.frameRateInput
{Number} OptionalThe Peer connection sending video streaming fps input. Defined asnull
if it's not available in original raw stats before parsing. -
sending.frameRateInput
{Number} OptionalThe Peer connection sending video streaming fps input. Defined asnull
if it's not available in original raw stats before parsing. -
sending.framesDropped
{Number} OptionalThe Peer connection sending video streaming frames dropped. Defined asnull
if it's not available in original raw stats before parsing. -
sending.frameRateMean
{Number} OptionalThe Peer connection sending video streaming fps mean. Defined asnull
if it's not available in original raw stats before parsing. -
sending.frameRateStdDev
{Number} OptionalThe Peer connection sending video streaming fps standard deviation. Defined asnull
if it's not available in original raw stats before parsing. -
sending.framesPerSecond
{Number} OptionalThe Peer connection sending video streaming fps. Defined asnull
if it's not available in original raw stats before parsing. -
sending.framesDecoded
{Number} OptionalThe Peer connection sending video streaming frames decoded. Defined asnull
if it's not available in original raw stats before parsing. -
sending.framesCorrupted
{Number} OptionalThe Peer connection sending video streaming frames corrupted. Defined asnull
if it's not available in original raw stats before parsing. -
sending.totalFrames
{Number} OptionalThe Peer connection total sending video streaming frames. Defined asnull
if it's not available in original raw stats before parsing. -
sending.nacks
{Number} OptionalThe Peer connection current sending video streaming nacks. Defined asnull
if it's not available in original raw stats before parsing. -
sending.totalNacks
{Number} OptionalThe Peer connection total sending video streaming nacks. Defined asnull
if it's not available in original raw stats before parsing. -
sending.plis
{Number} OptionalThe Peer connection current sending video streaming plis. Defined asnull
if it's not available in original raw stats before parsing. -
sending.totalPlis
{Number} OptionalThe Peer connection total sending video streaming plis. Defined asnull
if it's not available in original raw stats before parsing. -
sending.firs
{Number} OptionalThe Peer connection current sending video streaming firs. Defined asnull
if it's not available in original raw stats before parsing. -
sending.totalFirs
{Number} OptionalThe Peer connection total sending video streaming firs. Defined asnull
if it's not available in original raw stats before parsing. -
sending.slis
{Number} OptionalThe Peer connection current sending video streaming slis. Defined asnull
if it's not available in original raw stats before parsing. -
sending.totalSlis
{Number} OptionalThe Peer connection total sending video streaming slis. Defined asnull
if it's not available in original raw stats before parsing. -
receiving
{JSON}The Peer connection receiving video streaming stats. -
receiving.bytes
{Number}The Peer connection current receiving video streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps. -
receiving.totalBytes
{Number}The Peer connection total receiving video streaming bytes. Note that value is in bytes so you have to convert that to bits for displaying for an example kbps. -
receiving.packets
{Number}The Peer connection current receiving video streaming packets. -
receiving.totalPackets
{Number}The Peer connection total receiving video streaming packets. -
receiving.packetsLost
{Number}The Peer connection current receiving video streaming packets lost. -
receiving.fractionLost
{Number}The Peer connection current receiving video streaming fraction packets lost. -
receiving.packetsDiscarded
{Number}The Peer connection current receiving video streaming packets discarded. -
receiving.totalPacketsLost
{Number}The Peer connection total receiving video streaming packets lost. -
receiving.totalPacketsDiscarded
{Number}The Peer connection total receiving video streaming packets discarded. -
receiving.ssrc
{Number}The Peer connection receiving video streaming RTP packets SSRC. -
receiving.e2eDelay
{Number} OptionalThe Peer connection receiving video streaming e2e delay. Defined asnull
if it's not present in original raw stats before parsing, and that it finds any existing audio, video or object (plugin) DOM elements that has set with the Peer remote stream object to parse current time. Note thatdocument.getElementsByTagName
function and DOM.currentTime
has to be supported inorder for data to be parsed correctly. -
receiving.jitter
{Number}The Peer connection receiving video streaming RTP packets jitter in seconds. Defined as0
if it's not present in original raw stats before parsing. -
receiving.jitterBufferMs
{Number} OptionalThe Peer connection receiving video streaming RTP packets jitter buffer in miliseconds. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.codec
{JSON} OptionalThe Peer connection receiving video streaming selected codec information. Defined asnull
if remote session description is not available before parsing. Note that if the value is polyfilled, the value may not be accurate since the remote Peer can override the selected codec. The value is derived from the remote session description. -
receiving.codec.name
{String}The Peer connection receiving video streaming selected codec name. -
receiving.codec.payloadType
{Number}The Peer connection receiving video streaming selected codec payload type. -
receiving.codec.implementation
{String} OptionalThe Peer connection receiving video streaming selected codec implementation. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.codec.channels
{Number} OptionalThe Peer connection receiving video streaming selected codec channels (2 for stereo). Defined asnull
if it's not available in original raw stats before parsing, and this is usually present instats.audio
property. -
receiving.codec.clockRate
{Number} OptionalThe Peer connection receiving video streaming selected codec media sampling rate. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.codec.params
{String} OptionalThe Peer connection receiving video streaming selected codec parameters. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.frames
{Number} OptionalThe Peer connection receiving video streaming frames. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.framesOutput
{Number} OptionalThe Peer connection receiving video streaming fps output. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.framesDecoded
{Number} OptionalThe Peer connection receiving video streaming frames decoded. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.frameRateMean
{Number} OptionalThe Peer connection receiving video streaming fps mean. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.frameRateStdDev
{Number} OptionalThe Peer connection receiving video streaming fps standard deviation. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.framesPerSecond
{Number} OptionalThe Peer connection receiving video streaming fps. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.framesDecoded
{Number} OptionalThe Peer connection receiving video streaming frames decoded. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.framesCorrupted
{Number} OptionalThe Peer connection receiving video streaming frames corrupted. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.totalFrames
{Number} OptionalThe Peer connection total receiving video streaming frames. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.nacks
{Number} OptionalThe Peer connection current receiving video streaming nacks. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.totalNacks
{Number} OptionalThe Peer connection total receiving video streaming nacks. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.plis
{Number} OptionalThe Peer connection current receiving video streaming plis. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.totalPlis
{Number} OptionalThe Peer connection total receiving video streaming plis. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.firs
{Number} OptionalThe Peer connection current receiving video streaming firs. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.totalFirs
{Number} OptionalThe Peer connection total receiving video streaming firs. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.slis
{Number} OptionalThe Peer connection current receiving video streaming slis. Defined asnull
if it's not available in original raw stats before parsing. -
receiving.totalPlis
{Number} OptionalThe Peer connection total receiving video streaming slis. Defined asnull
if it's not available in original raw stats before parsing.
-
-
selectedCandidate
{JSON}The Peer connection selected ICE candidate pair stats.
-
local
{JSON}The Peer connection selected local ICE candidate. -
local.ipAddress
{String}The Peer connection selected local ICE candidate IP address. -
local.portNumber
{Number}The Peer connection selected local ICE candidate port number. -
local.transport
{String}The Peer connection selected local ICE candidate IP transport type. -
local.candidateType
{String}The Peer connection selected local ICE candidate type. -
local.turnMediaTransport
{String} OptionalThe Peer connection possible transport used when relaying local media to TURN server. Types are"UDP"
(UDP connections),"TCP"
(TCP connections) and"TCP/TLS"
(TCP over TLS connections). -
remote
{JSON}The Peer connection selected remote ICE candidate. -
remote.ipAddress
{String}The Peer connection selected remote ICE candidate IP address. -
remote.portNumber
{Number}The Peer connection selected remote ICE candidate port number. -
remote.transport
{String}The Peer connection selected remote ICE candidate IP transport type. -
remote.candidateType
{String}The Peer connection selected remote ICE candidate type. -
writable
{Boolean} OptionalThe flag if Peer has gotten ACK to an ICE request. Defined asnull
if it's not available in original raw stats before parsing. -
readable
{Boolean} OptionalThe flag if Peer has gotten a valid incoming ICE request. Defined asnull
if it's not available in original raw stats before parsing. -
rtt
{String} OptionalThe current STUN connectivity checks RTT (Round-trip delay time). Defined asnull
if it's not available in original raw stats before parsing. -
totalRtt
{String} OptionalThe total STUN connectivity checks RTT (Round-trip delay time). Defined asnull
if it's not available in original raw stats before parsing. -
requests
{JSON}The ICE connectivity check requests. -
requests.received