Link to Github: https://github.com/Temasys/SkylinkJS/releases/tag/0.6.16
Dependencies
Socket.io-client: 1.4.4
AdapterJS: 0.14.0
CDN links (gzipped)
Minified library: //cdn.temasys.com.sg/skylink/skylinkjs/0.6.16/skylink.min.js
Debug library: //cdn.temasys.com.sg/skylink/skylinkjs/0.6.16/skylink.debug.js
Minified with all dependencies://cdn.temasys.com.sg/skylink/skylinkjs/0.6.16/skylink.complete.min.js
Debug with all dependencies://cdn.temasys.com.sg/skylink/skylinkjs/0.6.16/skylink.complete.js
API Documentation
http://cdn.temasys.com.sg/skylink/skylinkjs/0.6.16/doc/classes/Skylink.html
NPM Installation
npm install skylinkjs@0.6.16
Bug-fixes
Datachannel
- Fixes to prevent dead Datachannel connections if Peer connection has already been closed.
- Fixes to ensure that CLOSED Datachannel state triggers on Firefox `48` and below despite native `.onclose` event not triggering.
- Fixes to ensure that `CLOSING` Datachannel state triggers for the Peer closing the Datachannel.
Transfers
- Fixes to tabulate completion of data transfers correctly from other SDKs. #257
- Fixes where data transfers with Android / iOS / C++ SDKs in `acceptDataTransfer()` method fails to start data transfers due to incorrect `transferId` generated in `dataTransferState` event. #257
- Fixes where data transfers with MCU Peer enabled Peers from Android / iOS / C++ SDKs was not progressing data transfers. #257
- Fixes when `peerConnectionState` triggers `CLOSED` state (for MCU enabled Peers only), or when `dataChannelState` triggers `ERROR`, `CREATE_ERROR`, `CLOSING` or `CLOSED` states while there is data transfer sessions progressing `dataTransferState` should trigger `ERROR` state.
- Fixes to ensure that data transfers with `sendURLData()` or multiple simultaneous data transfers should not be done if Peers connecting from the SDKs (e.g. Android / iOS / C++) do not support it. #257
- Fixes to `sendURLData()` and `sendBlobData()` methods docs for incorrect deprecation of `callback.success.transferId` as it should not be deprecated as `transferId` is not retrievable from `transferInfo` parameter payload of `dataTransferState` event.
- Fixes to `sendURLData()` and `sendBlobData()` methods docs for correct data transfer steps.
- Fixes for compliance to DT protocol version `0.1.0`.
- Fixes to ensure that `callback.error.transferInfo.name`, `callback.error.transferInfo.size` and `callback.error.transferId` value should be defined as `null` depending on the method execution states in `sendBlobData()` and `sendURLData()` methods. `callback.error.transferId` should be only defined when the data transfer session has started but failed, and `callback.error.transferInfo.name` should only be defined when `data` parameter provided is parsed correctly.
- Fixes to ensure `dataTransferState` is triggered only for Peers not `MCU` server Peer for MCU enabled Peer connections.
- Fixes to ensure that the `error.transferType` payload parameter is correctly defined when `dataTransferState` event triggers `ERROR` state.
- Fixes to `sendURLData()` and `sendBlobData()` methods docs for example codes that is not working when it should be `files[0]` instead of `Files[0]`.
Peer
- Fixes to `refreshConnection()` method docs default throttling of `5000` ms not being documented. This can be configured now in the `init()` method `throttlingIntervals.refreshConnection` parameter.
- Workaround fixes for Chrome and Firefox re-negotiation issues where if Chrome (audio+video) connects with Firefox (video) and then switches to a (video) Stream, session description errors are thrown. This is a known Chrome bug issue in [here](https://bugs.chromium.org/p/webrtc/issues/detail?id=6280).
- Fixes for `candidateGenerationState` event not triggering `GATHERING` state when ICE candidates are actually gathering.
- Fixes for `getUserData()` not return User's `peerInfo.userData` when provided Peer ID is invalid.
- Fixes for `setUserData()` enforcing `peerInfo.userData` as string if provided `userData` parameter is `false`.
- Fixes for `getPeerInfo()` to return `peerInfo.userData` as empty string if not defined.
- Fixes for `getPeerInfo()` to return default `peerInfo` values when they are not defined correctly from Peers connecting from other SDKs.
- Fixes for occasional ICE connection `FAILED` state due to out-of-protocol changes in [`0.6.15` release](https://github.com/Temasys/SkylinkJS/releases/tag/0.6.15) with `MCU` server Peer connection.
- Fixes for `options.bandwidth` in `joinRoom()` parameters to ensure compliance to [RFC 4566](https://tools.ietf.org/html/rfc4566) specification where `b=AS` lines should be configured after the respective `c=` lines.
- Fixes for User's `peerInfo.settings.bandwidth` not being received by the other Peer. #271
- Fixes to ensure `host` ICE candidates are removed from the session description received to honor `options.forceTURN` config in `init()` method.
Room
- Fixes to prevent `Cannot read property "2" of undefined` error when `callback` provided in `off()` is not defined or is a type of `function`.
- Fixes when joining a new room in `joinRoom()` overrides the `init()` configuration set.
- Fixes for `incomingMessage` event `peerId` parameter missing in docs.
- Fixes for `roomLock` event `peerId` parameter missing in docs.
- Fixes for `options.defaultRoom` parameter value not being set as the `options.appKey` parameter value when provided as an empty string in the `init()` method.
- Fixes for `joinRoom()` method not invoking `init()` method internally and retrieving new Room session credentials when invoking `joinRoom()` with the same Room name as the `init()` method. This may result in `systemAction` event triggering `REJECT` action with `EXPIRED` reason as Room credentials has expired.
- Fixes for `readyStateChange` event parameter payload `readyState` being documented as type of `string` when it is supposed to be `number` in the docs. #269
- Fixes for events being shared. #232
Socket
- Fixes for socket message queueing algorithm for causing `systemAction` to still trigger `WARNING` action with `FAST_MESSAGE` reason.
- Fixes for `readyStateChange` event parameter payload `readyState` being documented as type of `string` when it is supposed to be `number` in the docs. #269
Stream
- Fixes for multiple triggers of `streamEnded` event. #264
- Fixes for Firefox browser TypeError when providing a custom MediaStream object in sendStream() method and receiving peerInfo.settings.video as a boolean from non-Web SDKs. #259
- Fixes for `streamEnded` event being triggered for `MCU` server Peer.
- Fixes to `shareScreen()` method docs default throttling of `10000` ms not being documented. This can be configured now in the `init()` method `throttlingIntervals.shareScreen` parameter.
- Fixes to `init()`parameter `options.audioCodec` and `options.videoCodec`, `joinRoom()` parameter `options.bandwidth` and `getUserMedia()` parameters `options.audio.stereo` selection of codec parameter direction. Bandwidth and OPUS is configured for both remote/local, which means the receiving settings can be overridden. Audio/Video codec is configured for local, which means the receiving settings can be overridden from the other SDKs Peers.
- Fixes for `joinRoom()` parameter `options.bandwidth` upload max bandwidth not working because it was not configured on remote.
- Fixes to ensure that `streamEnded` triggers for all Streams that is known and sent to Peer when Peer connection has ended.
Improvements
Datachannel
- Added `CREATE_ERROR` property in `DATA_CHANNEL_STATE` constant which Datachannel state triggers when creating Datachannel has errors.
- Added `BUFFERED_AMOUNT_LOW` property in `DATA_CHANNEL_STATE` constant which Datachannel state triggers when buffered data to be sent in Datachannel falls below the threshold limit.
- Added `SEND_MESSAGE_ERROR` property in `DATA_CHANNEL_STATE` constant which Datachannel state triggers when data to be sent in Datachannel is dropped because Datachannel state is not `OPEN`.
Transfers
- Added `ARRAY_BUFFER` property in `DATA_TRANSFER_DATA_TYPE` constant which identifies the transferring data packets type in the data transfer session is `ArrayBuffer`. This only happens for `sendBlobData()` method.
- Added `BLOB` property in `DATA_TRANSFER_DATA_TYPE` constant which identifies the transferring data packets type in the data transfer session is `Blob`. This only happens for `sendBlobData()` method.
- Added `STRING` property in `DATA_TRANSFER_DATA_TYPE` constant which identifies the transferring data packets type in the data transfer session is `string`. This will only happen for `sendURLData()` method.
- Removal of deprecated `respondBlobRequest()` and `cancelBlobTransfer()` methods in docs. The methods can still be used for `0.6.x` versions as they function the same as `acceptDataTransfer()` and `cancelDataTransfer()` methods but it's not supported. #261
- Removal of deprecated `callback.success.isPrivate`, `callback.error.isPrivate`, `callback.success.state`, `callback.error.state`, `callback.success.peerId`, `callback.error.peerId` and `callback.error.error` properties in `sendBlobData()` and `sendURLData()` methods. These values can be retrieved from `callback.success.listOfPeers`, `callback.error.listOfPeers`, `callback.success.transferInfo`, `callback.error.transferInfo` and `callback.error.transferErrors` except for `callback.success.state` and `callback.error.state` as it is better by using `dataTransferState` event. #261
- Added `USER_UPLOAD_REQUEST` property to `DATA_TRANSFER_STATE` constant which data transfer state triggers when it is User who is sending Peer the uploading data transfer request.
- Added `USER_REJECTED` property to `DATA_TRANSFER_STATE` constant which data transfer state triggers when it is User who is rejecting Peer's uploading data transfer request.
- Prevent start data transfers in `sendURLData()` and `sendBlobData()` methods if no Peers are connected.
Peer
- Prevent `forceTURNSSL` from being enabled by default when User is accessing from `https:` web apps as TURNS (TURN/TLS) is not mandatory for accessing `https:` web apps and gives developers to use both TURN and TURNS protocol for Users accessing the `https:` web apps.
- Prevent Peer connection restarts when ICE connection state is `FAILED` or `DISCONNECTED`, but can be done by invoking `refreshConnection()` method from Peer's end.
- Throttling for `refreshConnection()` method is done only for MCU enabled Peers.
- Removal of Peer connection timers as it could be interfering with slow network connections and it is causing overheads.
- Added `peerInfo.config` that allows Users to retrieve the Peer connection configuration.
- Updated docs for clarity when `peerInfo.settings.audio` value is `true`, `peerInfo.settings.audio.stereo` is considered as `false`.
- Updated docs for clarity when `peerInfo.settings.video` value is `true`, `peerInfo.settings.video.screenshare` is considered as `false`.
- Use the best preferred version (like `/48000` over `/16000`) of the codec selected.
- Ensure that with `MCU` server Peer, it should be send only, and with MCU enabled Peers, it should be received only.
- Added `stats.audio.sending.jitter`, `stats.audio.sending.jitterBufferMs`, `stats.audio.sending.totalPackets`, `stats.audio.sending.totalBytes`, `stats.audio.sending.totalPacketsLost`, `stats.audio.sending.codec`, `stats.audio.sending.codec`, `stats.audio.sending.inputLevel`, `stats.audio.sending.echoReturnLoss`, `stats.audio.sending.echoReturnLossEnhancement`, `stats.audio.receiving.jitter`, `stats.audio.receiving.jitterBufferMs`, `stats.audio.receiving.totalPackets`, `stats.audio.receiving.totalBytes`, `stats.audio.receiving.totalPacketsLost`, `stats.audio.receiving.codec`, `stats.audio.receiving.codec`, `stats.audio.receiving.outputLevel`, `stats.video.sending.jitter`, `stats.video.sending.jitterBufferMs`, `stats.video.sending.totalPackets`, `stats.video.sending.totalBytes`, `stats.video.sending.totalPacketsLost`, `stats.video.sending.codec`, `stats.video.sending.frames`, `stats.video.sending.framesInput`, `stats.video.sending.framesDropped`, `stats.video.sending.frameRateMean`, `stats.video.sending.frameRateStdDev`, `stats.video.sending.nacks`, `stats.video.sending.totalNacks`, `stats.video.sending.plis`, `stats.video.sending.totalPlis`, `stats.video.sending.firs`, `stats.video.sending.totalFirs`, `stats.video.receiving.jitter`, `stats.video.receiving.jitterBufferMs`, `stats.video.receiving.totalPackets`, `stats.video.receiving.totalBytes`, `stats.video.receiving.totalPacketsLost`, `stats.video.receiving.codec`, `stats.video.receiving.frames`, `stats.video.receiving.framesOutput`, `stats.video.receiving.framesDropped`, `stats.video.receiving.frameRateMean`, `stats.video.receiving.frameRateStdDev`, `stats.video.receiving.nacks`, `stats.video.receiving.plis`, `stats.video.receiving.firs`, `stats.video.receiving.totalNacks`, `stats.video.receiving.totalPlis`, `stats.video.receiving.totalFirs`, `stats.video.receiving.e2eDelay` parameters payload to `getConnectionStatusStateChange` event.
- Removed polyfill of `iceConnectionState` event parameter payload `state`. ICE connection states can go from `"connecting"` to `"connected"` or `"completed"`.
Room
- Removal of deprecated `REGIONAL_SERVER` constant. The constant is still defined for `0.6.x` versions but it's not supported since automatic regional server selection is implemented. #261
- Removal of deprecated `options.region` parameter in `init()` method. The feature is no longer supported since automatic regional server selection is implemented.
- Removal of deprecated `callback.success.serverRegion` in `init()` method. The feature is no longer supported since automatic regional server selection is implemented.
- Opened Socket connections should still be closed despite User not being in Room when `leaveRoom()` method is invoked except that Streams are not stopped and `callback.error` will still be returned.
- `roomLock` event should only be triggered when queued action is sent.
- `incomingMessage` event should only be triggered when queued broadcasted message is sent.
Socket
- Prevent sending queued outdated User `peerInfo.settings.mediaStatus` and `peerInfo.settings.userData` to other Peers connecting from other SDKs.
- Compliance to SM protocol version `0.1.2.3`.
Stream
- Added `isScreensharing` and `streamId` parameter payload to `incomingStream` event.
New Features
Datachannel
- Added `messageType` parameter payload to `dataChannelState` event for identifying the type of send data error when Datachannel state is `SEND_MESSAGE_ERROR`. The list of possible values can be identified with `DATA_CHANNEL_MESSAGE_ERROR` constant.
- Added `DATA_CHANNEL_MESSAGE_ERROR` constant which lists the types of send data errors when Datachannel state is `SEND_MESSAGE_ERROR`.
Transfers
- Added `transferInfo.chunkType` parameter payload to `dataTransferState` event for identifying the data chunk type transferred. The list of possible values can be identified with `DATA_TRANSFER_DATA_TYPE`.
- Added `transferInfo.chunkSize` parameter payload to `dataTransferState` event for identifying the data chunk type transferred.
- Added `transferInfo.mimeType` parameter payload to `dataTransferState` event for identifying the data transfer `Blob` data MIME type if defined.
- Added `transferInfo.direction` parameter payload to `dataTransferState` event for identifying the data transfer direction. The list of possible values can be identified with `DATA_TRANSFER_TYPE`.
- Added `sendChunksAsBinary` parameter in `sendBlobData()` that allows you to transfer data chunks using binary data, which will be faster because there is no conversion required. This is only supported with Web SDKs with non-MCU enabled Peers.
- Added `DATA_TRANSFER_SESSION_TYPE` constant which lists of the types of data transfer session types.
Peer
- Added `candidateProcessingState` event for received remote ICE candidates processing state when trickle ICE is enabled in `init()` method used for debugging purposes.
- Added `CANDIDATE_PROCESSING_STATE` constant which lists of the processing states of a remote ICE candidates.
- Added `iceRestart` parameter in `refreshConnection()` method to allow Peers to refresh ICE connections by generating new session description ICE credentials. To is useful for more successful ICE reconnection when ICE connection state is `FAILED` or `DISCONNECTED`, since ICE connection is used to relay Stream and Datachannel data packets.
- Added `isIceRestart` payload parameter in `peerRestart` event when Peer connection restart will do an ICE restart.
- Added `options.filterCandidatesType` parameter to `init()` method which allows filtering of local and remote ICE candidates types like `host` (local network), `srflx` (STUN) and `relay` (TURN). Note that this is primarily used as a debugging feature and may affect connections, so do it at your own risk.
- Added `options.disableVideoFecCodecs` parameter to `init()` method which allows removal of FEC codecs like ulpfec and red as these codecs may incur overheads. Note that this feature is only allowed for non-MCU enabled Peer connections and may affect connections.
- Added `options.disableComfortNoiseCodec` parameter to `init()` method which allows removal of CN (Comfort Noise) codec which removes sounds when it's below a certain level of threshold, and might be useful for Users who prefer maintaining audio quality. Note that this is experimental and may affect connections.
- Added `options.disableREMB` parameter to `init()` method which removes the video REMB packets meant only for debugging purposes.
Room
- Added `getPeersInRoom()` method that returns the list of Peers connected in the Room. Note that this is different from `getPeers()` method which returns the list of Peer IDs in the same App space.
- Added `options.googleXBandwidth` parameter to `joinRoom()` method which allows developers to set the minimum and maximum `google-x-bandwidth` (VP8/VP9 codec) video streaming bandwidth settings. Note that this is experimental and may not be supported.
- Added `options.throttleIntervals` parameter to `init()` method which allows developers to set the throttling interval timeouts for `shareScreen()`, `getUserMedia()` and `refreshConnection()` (for MCU enabled Peers only).
- Added `options.throttleShouldThrowError` parameter to `init()` method which allows developers to throw throttling errors (which returns `callback.error` in the respective methods) when throttled methods are invoked within less than the specified interval timeout after the previous invoke.
- (beta) Added `startRecording()` method to start recording of Streams for only MCU enabled Peer connections.
- (beta) Added `stopRecording()` method to stop recording of Streams for only MCU enabled Peer connections.
- (beta) Added `getRecordings()` method to retrieve the list of known recording sessions in the Room since User has been connected to the Room.
- (beta) Added `recordingState` event for recording session states.
- (beta) Added `RECORDING_STATE` constant which lists of the recording session states.
Stream
- Added `VP9` property in `VIDEO_CODEC` constant to allow [VP9](https://en.wikipedia.org/wiki/VP9) video codec support which can be configured in the `init()` method `options.videoCodec` parameter.
- Added `G722` property in `AUDIO_CODEC` constant to allow [G722](https://en.wikipedia.org/wiki/G.722) audio codec support which can be configured in the `init()` method `options.audioCodec` parameter.
- Added throttling feature in `getUserMedia()` which has a default of `0` ms interval timeout value. This can be configured now in the `init()` method `throttlingIntervals.getUserMedia` parameter.
- Added `options.audio.usedtx` to allow DTX (Discontinuous Transmission) when encoding audio codec is `OPUS` for sending audio data. Note that this is experiemental and may not be supported.
- Added `options.audio.useinbandfec` to use in-band FEC (Forward Error Correction) when encoding audio codec is `OPUS` for sending audio data. Note that this is experiemental and may not be supported.
- Added `options.audio.maxplaybackrate` to set the maximum output sampling rate rendered in Hertz (Hz) when encoding audio codec is `OPUS` for sending audio data. Note that this is experiemental and may not be supported.
- - Added `getPeersStreams()` method to retrieve the list of current Peer Streams. #274
- - Added `options.mcuUseRenegoRestart` flag in `init()` method that allows beta support for MCU renegotiation method.
- - Added `options.sdpSettings` options in `joinRoom()` that toggles the SDP connection / direction settings. This is an experimental feature not to be meddled with example for debugging purposes.
- - Added `options.publishOnly` options in `joinRoom()` that allows beta support for publishing your Stream only but not receiving other Peers stream.
Debugging
- Added `NONE` property in `LOG_LEVEL` constant to allow developers to turn off logging completely when using `skylink.debug.js` or `skylink.complete.js` file. Note that `skylink.complete.min.js` and `skylink.min.js` removes all console logging.new new