Skip to content

Commit

Permalink
Merged in pre-prod-2-0 (pull request #429)
Browse files Browse the repository at this point in the history
Release 2.3.0
  • Loading branch information
dinawee committed Jun 9, 2021
2 parents 2f5f96b + d741ffb commit 3b0c053
Show file tree
Hide file tree
Showing 535 changed files with 37,299 additions and 13,688 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SKYLINK WEB SDK 2.2.5
# SKYLINK WEB SDK 2.3.0
> Temasys SkylinkJS Web SDK is an open-source client-side library for your web-browser that enables any website to easily leverage the capabilities of WebRTC and its direct data streaming powers between peers for audio/video conferencing.
You'll need a Temasys Account, and an App key to use this. [Register here to get your App key](https://console.temasys.io).
Expand Down Expand Up @@ -34,7 +34,7 @@ You'll need a Temasys Account, and an App key to use this. [Register here to get
- We recommend that you always use the latest versions of the Temasys SkylinkJS Web SDK as WebRTC is still evolving and we adapt to changes very frequently.
- It is advised to not attach any event handlers to the WebRTC APIs as doing so may override the handlers set in SkylinkJS and result in unexpected behaviour.

[Latest version: 2.2.5](https://github.com/Temasys/SkylinkJS/releases/tag/2.2.5)
[Latest version: 2.3.0](https://github.com/Temasys/SkylinkJS/releases/tag/2.3.0)


## How to build your own Temasys SkylinkJS Web SDK
Expand Down
26 changes: 26 additions & 0 deletions demos/collection/kitchensink/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,32 @@ <h3>Chat Log</h3>
<button id="send_message_button" class="btn btn-primary">Send Message</button>
</div>
</div>

<div id="file_transfer_panel" class="col-md-12">
<div>
<h3>File Transfer</h3>
</div>
<div>
<input type="file" id="file_input" autofocus/>
</div>
<div>
<button id="send_file_button" class="btn btn-primary">Send File</button>
</div>
<div>
<button id="cancel_transfer_button" class="btn btn-primary">Cancel transfer</button>
</div>
<div>
<table id="transfers" class="table">
<tr>
<th>TransferId</th>
<th></th>
<th>Peer</th>
<th>File</th>
<th>Status</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
Expand Down
95 changes: 95 additions & 0 deletions demos/collection/kitchensink/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Demo._Skylink = Skylink;
Demo.isMCU = false;
Demo.videoStream = null;
Demo.audioStream = null;
Demo.transferIds = [];


window.Demo = Demo;
Expand Down Expand Up @@ -604,6 +605,87 @@ SkylinkEventManager.addEventListener(SkylinkConstants.EVENTS.CHANNEL_REOPEN, (ev
Demo.Methods.logToConsoleDOM(`CHANNEL_REOPEN`, 'info');
});


// //---------------------------------------------------
// // DATA TRANSFER EVENTS
// //---------------------------------------------------
SkylinkEventManager.addEventListener(SkylinkConstants.EVENTS.DATA_TRANSFER_STATE, (evt) => {
Demo.Methods.logToConsoleDOM(`DATA_TRANSFER_STATE`, 'info');
const { state, transferInfo, peerId, transferId } = evt.detail;

let transferStatus;
let isUpload;
let transfers;
let item;
switch (state) {
case SkylinkConstants.DATA_TRANSFER_STATE.UPLOAD_REQUEST:
var result = confirm('Incoming transfer request!\n\nFile: ' + transferInfo.name +
'\n\nSize: ' + transferInfo.size + '\n\nAccept?');
Demo.Skylink.respondBlobRequest(config.defaultRoom, peerId, transferId, result)
.then((result) => console.log("respondBlobRequest", result))
.catch((err) => console.log("respondBlobRequest", err))
break;
case SkylinkConstants.DATA_TRANSFER_STATE.UPLOAD_STARTED:
Demo.transferIds[peerId] = transferId;
isUpload = true;
transfers = document.getElementById('transfers');
item = document.createElement('tr');
item.innerHTML = '<td>' + transferId + '</td><td class="text-center">' +
((isUpload) ? '&#8657;' : '&#8659;') + '</td>' +
'<td class="text-center">' + peerId + '</td><td class="text-center">' + transferInfo.name +
'</td><td class="text-center"><span id="' + peerId + '_' + transferId + '"></span>' +
((!isUpload) ? '<a id="' + transferId + '" href="#" download="' +
transferInfo.name + '" style="display:none">Download</a>' : '') + '</td>';
transfers.appendChild(item);
break;
case SkylinkConstants.DATA_TRANSFER_STATE.DOWNLOAD_STARTED:
Demo.transferIds[peerId] = transferId;
isUpload = false;
transfers = document.getElementById('transfers');
item = document.createElement('tr');
item.innerHTML = '<td>' + transferId + '</td><td class="text-center">' +
((isUpload) ? '&#8657;' : '&#8659;') + '</td>' +
'<td class="text-center">' + peerId + '</td><td class="text-center">' + transferInfo.name +
'</td><td class="text-center"><span id="' + peerId + '_' + transferId + '"></span>' +
((!isUpload) ? '<a id="' + transferId + '" href="#" download="' +
transferInfo.name + '" style="display:none">Download</a>' : '') + '</td>';
transfers.appendChild(item);
break;
case SkylinkConstants.DATA_TRANSFER_STATE.CANCEL:
console.log("CANCEL DATA TRANSFER");
delete Demo.transferIds[peerId];
break;
case SkylinkConstants.DATA_TRANSFER_STATE.ERROR:
break;
case SkylinkConstants.DATA_TRANSFER_STATE.UPLOADING:
break;
case SkylinkConstants.DATA_TRANSFER_STATE.DOWNLOADING:
break;
case SkylinkConstants.DATA_TRANSFER_STATE.UPLOAD_COMPLETED:
transferStatus = document.getElementById(peerId + '_' + transferId);
transferStatus.innerHTML = 'Completed';
transferStatus.href = URL.createObjectURL(transferInfo.data);
delete Demo.transferIds[peerId];
break;
case SkylinkConstants.DATA_TRANSFER_STATE.DOWNLOAD_COMPLETED:
transferStatus = document.getElementById(peerId + '_' + transferId);
transferStatus.innerHTML = 'Completed';

transferStatus = document.getElementById(transferId);
transferStatus.href = URL.createObjectURL(transferInfo.data);
transferStatus.style.display = 'block';
break;
case SkylinkConstants.DATA_TRANSFER_STATE.USER_REJECTED:
break;
case SkylinkConstants.DATA_TRANSFER_STATE.USER_UPLOAD_REQUEST:
break;
case SkylinkConstants.DATA_TRANSFER_STATE.START_ERROR:
break;
}

});


// //---------------------------------------------------
// // STATE EVENTS
// //---------------------------------------------------
Expand Down Expand Up @@ -954,6 +1036,19 @@ $(document).ready(function() {
$('#chat_input').val('');
});
// //---------------------------------------------------
$('#send_file_button').click(function(e) {
Demo.Skylink.sendBlobData(config.defaultRoom, $('#file_input').prop('files')[0], null)
.then((res) => console.log("sendBlobData", res))
.catch((err) => console.error("sendBlobData", err));
});
// //---------------------------------------------------
$('#cancel_transfer_button').click(function(e) {
const transferPeers = Object.keys(Demo.transferIds);
Demo.Skylink.cancelBlobTransfer(config.defaultRoom, transferPeers[0], Demo.transferIds[transferPeers[0]])
.then((res) => console.log("cancelBlobTransfer", res))
.catch((err) => console.error("cancelBlobTransfer", err));
})
// //---------------------------------------------------
$('#set_persistent_message').click(function(e) {
if (e.currentTarget.checked) {
Demo.Skylink.setMessagePersistence(config.defaultRoom, true);
Expand Down
2 changes: 1 addition & 1 deletion docs/Reconnection.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ <h3 class="reference-title">



<h3>Classes</h3><ul><li id="Skylink-nav"><a href="Skylink.html">Skylink</a><ul class='methods'><li data-type="method" id="Skylink-deleteEncryptSecrets-nav"><a href="Skylink.html#deleteEncryptSecrets">deleteEncryptSecrets</a></li><li data-type="method" id="Skylink-generateUUID-nav"><a href="Skylink.html#generateUUID">generateUUID</a></li><li data-type="method" id="Skylink-getConnectionStatus-nav"><a href="Skylink.html#getConnectionStatus">getConnectionStatus</a></li><li data-type="method" id="Skylink-getEncryptSecrets-nav"><a href="Skylink.html#getEncryptSecrets">getEncryptSecrets</a></li><li data-type="method" id="Skylink-getMessagePersistence-nav"><a href="Skylink.html#getMessagePersistence">getMessagePersistence</a></li><li data-type="method" id="Skylink-getPeerInfo-nav"><a href="Skylink.html#getPeerInfo">getPeerInfo</a></li><li data-type="method" id="Skylink-getPeers-nav"><a href="Skylink.html#getPeers">getPeers</a></li><li data-type="method" id="Skylink-getPeersCustomSettings-nav"><a href="Skylink.html#getPeersCustomSettings">getPeersCustomSettings</a></li><li data-type="method" id="Skylink-getPeersDataChannels-nav"><a href="Skylink.html#getPeersDataChannels">getPeersDataChannels</a></li><li data-type="method" id="Skylink-getPeersInRoom-nav"><a href="Skylink.html#getPeersInRoom">getPeersInRoom</a></li><li data-type="method" id="Skylink-getRecordings-nav"><a href="Skylink.html#getRecordings">getRecordings</a></li><li data-type="method" id="Skylink-getSdkVersion-nav"><a href="Skylink.html#getSdkVersion">getSdkVersion</a></li><li data-type="method" id="Skylink-getSelectedSecret-nav"><a href="Skylink.html#getSelectedSecret">getSelectedSecret</a></li><li data-type="method" id="Skylink-getStoredMessages-nav"><a href="Skylink.html#getStoredMessages">getStoredMessages</a></li><li data-type="method" id="Skylink-getStreams-nav"><a href="Skylink.html#getStreams">getStreams</a></li><li data-type="method" id="Skylink-getStreamSources-nav"><a href="Skylink.html#getStreamSources">getStreamSources</a></li><li data-type="method" id="Skylink-getUserData-nav"><a href="Skylink.html#getUserData">getUserData</a></li><li data-type="method" id="Skylink-getUserMedia-nav"><a href="Skylink.html#getUserMedia">getUserMedia</a></li><li data-type="method" id="Skylink-joinRoom-nav"><a href="Skylink.html#joinRoom">joinRoom</a></li><li data-type="method" id="Skylink-leaveAllRooms-nav"><a href="Skylink.html#leaveAllRooms">leaveAllRooms</a></li><li data-type="method" id="Skylink-leaveRoom-nav"><a href="Skylink.html#leaveRoom">leaveRoom</a></li><li data-type="method" id="Skylink-lockRoom-nav"><a href="Skylink.html#lockRoom">lockRoom</a></li><li data-type="method" id="Skylink-muteStreams-nav"><a href="Skylink.html#muteStreams">muteStreams</a></li><li data-type="method" id="Skylink-refreshConnection-nav"><a href="Skylink.html#refreshConnection">refreshConnection</a></li><li data-type="method" id="Skylink-refreshDatachannel-nav"><a href="Skylink.html#refreshDatachannel">refreshDatachannel</a></li><li data-type="method" id="Skylink-sendMessage-nav"><a href="Skylink.html#sendMessage">sendMessage</a></li><li data-type="method" id="Skylink-sendP2PMessage-nav"><a href="Skylink.html#sendP2PMessage">sendP2PMessage</a></li><li data-type="method" id="Skylink-sendStream-nav"><a href="Skylink.html#sendStream">sendStream</a></li><li data-type="method" id="Skylink-setEncryptSecret-nav"><a href="Skylink.html#setEncryptSecret">setEncryptSecret</a></li><li data-type="method" id="Skylink-setMessagePersistence-nav"><a href="Skylink.html#setMessagePersistence">setMessagePersistence</a></li><li data-type="method" id="Skylink-setSelectedSecret-nav"><a href="Skylink.html#setSelectedSecret">setSelectedSecret</a></li><li data-type="method" id="Skylink-setUserData-nav"><a href="Skylink.html#setUserData">setUserData</a></li><li data-type="method" id="Skylink-shareScreen-nav"><a href="Skylink.html#shareScreen">shareScreen</a></li><li data-type="method" id="Skylink-startRecording-nav"><a href="Skylink.html#startRecording">startRecording</a></li><li data-type="method" id="Skylink-startRTMPSession-nav"><a href="Skylink.html#startRTMPSession">startRTMPSession</a></li><li data-type="method" id="Skylink-stopRecording-nav"><a href="Skylink.html#stopRecording">stopRecording</a></li><li data-type="method" id="Skylink-stopRTMPSession-nav"><a href="Skylink.html#stopRTMPSession">stopRTMPSession</a></li><li data-type="method" id="Skylink-stopScreen-nav"><a href="Skylink.html#stopScreen">stopScreen</a></li><li data-type="method" id="Skylink-stopStreams-nav"><a href="Skylink.html#stopStreams">stopStreams</a></li><li data-type="method" id="Skylink-unlockRoom-nav"><a href="Skylink.html#unlockRoom">unlockRoom</a></li></ul></li><li id="SkylinkLogger-nav"><a href="SkylinkLogger.html">SkylinkLogger</a><ul class='methods'><li data-type="method" id="SkylinkLogger-disableAll-nav"><a href="SkylinkLogger.html#disableAll">disableAll</a></li><li data-type="method" id="SkylinkLogger-enableAll-nav"><a href="SkylinkLogger.html#enableAll">enableAll</a></li><li data-type="method" id="SkylinkLogger-setLevel-nav"><a href="SkylinkLogger.html#setLevel">setLevel</a></li></ul></li></ul><h3>Namespaces</h3><ul><li id="Reconnection-nav"><a href="Reconnection.html">Reconnection</a></li><li id="SkylinkConstants-nav"><a href="SkylinkConstants.html">SkylinkConstants</a></li><li id="SkylinkEvents-nav"><a href="SkylinkEvents.html">SkylinkEvents</a></li></ul><h3 id="global-nav">Global</h3><ul><li><a href="global.html#AdapterJS">AdapterJS</a></li><li><a href="global.html#io">io</a></li></ul>
<h3>Classes</h3><ul><li id="Skylink-nav"><a href="Skylink.html">Skylink</a><ul class='methods'><li data-type="method" id="Skylink-cancelBlobTransfer-nav"><a href="Skylink.html#cancelBlobTransfer">cancelBlobTransfer</a></li><li data-type="method" id="Skylink-deleteEncryptSecrets-nav"><a href="Skylink.html#deleteEncryptSecrets">deleteEncryptSecrets</a></li><li data-type="method" id="Skylink-generateUUID-nav"><a href="Skylink.html#generateUUID">generateUUID</a></li><li data-type="method" id="Skylink-getConnectionStatus-nav"><a href="Skylink.html#getConnectionStatus">getConnectionStatus</a></li><li data-type="method" id="Skylink-getEncryptSecrets-nav"><a href="Skylink.html#getEncryptSecrets">getEncryptSecrets</a></li><li data-type="method" id="Skylink-getMessagePersistence-nav"><a href="Skylink.html#getMessagePersistence">getMessagePersistence</a></li><li data-type="method" id="Skylink-getPeerInfo-nav"><a href="Skylink.html#getPeerInfo">getPeerInfo</a></li><li data-type="method" id="Skylink-getPeers-nav"><a href="Skylink.html#getPeers">getPeers</a></li><li data-type="method" id="Skylink-getPeersCustomSettings-nav"><a href="Skylink.html#getPeersCustomSettings">getPeersCustomSettings</a></li><li data-type="method" id="Skylink-getPeersDataChannels-nav"><a href="Skylink.html#getPeersDataChannels">getPeersDataChannels</a></li><li data-type="method" id="Skylink-getPeersInRoom-nav"><a href="Skylink.html#getPeersInRoom">getPeersInRoom</a></li><li data-type="method" id="Skylink-getRecordings-nav"><a href="Skylink.html#getRecordings">getRecordings</a></li><li data-type="method" id="Skylink-getSdkVersion-nav"><a href="Skylink.html#getSdkVersion">getSdkVersion</a></li><li data-type="method" id="Skylink-getSelectedSecret-nav"><a href="Skylink.html#getSelectedSecret">getSelectedSecret</a></li><li data-type="method" id="Skylink-getStoredMessages-nav"><a href="Skylink.html#getStoredMessages">getStoredMessages</a></li><li data-type="method" id="Skylink-getStreams-nav"><a href="Skylink.html#getStreams">getStreams</a></li><li data-type="method" id="Skylink-getStreamSources-nav"><a href="Skylink.html#getStreamSources">getStreamSources</a></li><li data-type="method" id="Skylink-getUserData-nav"><a href="Skylink.html#getUserData">getUserData</a></li><li data-type="method" id="Skylink-getUserMedia-nav"><a href="Skylink.html#getUserMedia">getUserMedia</a></li><li data-type="method" id="Skylink-joinRoom-nav"><a href="Skylink.html#joinRoom">joinRoom</a></li><li data-type="method" id="Skylink-leaveAllRooms-nav"><a href="Skylink.html#leaveAllRooms">leaveAllRooms</a></li><li data-type="method" id="Skylink-leaveRoom-nav"><a href="Skylink.html#leaveRoom">leaveRoom</a></li><li data-type="method" id="Skylink-lockRoom-nav"><a href="Skylink.html#lockRoom">lockRoom</a></li><li data-type="method" id="Skylink-muteStreams-nav"><a href="Skylink.html#muteStreams">muteStreams</a></li><li data-type="method" id="Skylink-refreshConnection-nav"><a href="Skylink.html#refreshConnection">refreshConnection</a></li><li data-type="method" id="Skylink-refreshDatachannel-nav"><a href="Skylink.html#refreshDatachannel">refreshDatachannel</a></li><li data-type="method" id="Skylink-respondBlobRequest-nav"><a href="Skylink.html#respondBlobRequest">respondBlobRequest</a></li><li data-type="method" id="Skylink-sendBlobData-nav"><a href="Skylink.html#sendBlobData">sendBlobData</a></li><li data-type="method" id="Skylink-sendMessage-nav"><a href="Skylink.html#sendMessage">sendMessage</a></li><li data-type="method" id="Skylink-sendP2PMessage-nav"><a href="Skylink.html#sendP2PMessage">sendP2PMessage</a></li><li data-type="method" id="Skylink-sendStream-nav"><a href="Skylink.html#sendStream">sendStream</a></li><li data-type="method" id="Skylink-setEncryptSecret-nav"><a href="Skylink.html#setEncryptSecret">setEncryptSecret</a></li><li data-type="method" id="Skylink-setMessagePersistence-nav"><a href="Skylink.html#setMessagePersistence">setMessagePersistence</a></li><li data-type="method" id="Skylink-setSelectedSecret-nav"><a href="Skylink.html#setSelectedSecret">setSelectedSecret</a></li><li data-type="method" id="Skylink-setUserData-nav"><a href="Skylink.html#setUserData">setUserData</a></li><li data-type="method" id="Skylink-shareScreen-nav"><a href="Skylink.html#shareScreen">shareScreen</a></li><li data-type="method" id="Skylink-startRecording-nav"><a href="Skylink.html#startRecording">startRecording</a></li><li data-type="method" id="Skylink-startRTMPSession-nav"><a href="Skylink.html#startRTMPSession">startRTMPSession</a></li><li data-type="method" id="Skylink-stopRecording-nav"><a href="Skylink.html#stopRecording">stopRecording</a></li><li data-type="method" id="Skylink-stopRTMPSession-nav"><a href="Skylink.html#stopRTMPSession">stopRTMPSession</a></li><li data-type="method" id="Skylink-stopScreen-nav"><a href="Skylink.html#stopScreen">stopScreen</a></li><li data-type="method" id="Skylink-stopStreams-nav"><a href="Skylink.html#stopStreams">stopStreams</a></li><li data-type="method" id="Skylink-unlockRoom-nav"><a href="Skylink.html#unlockRoom">unlockRoom</a></li></ul></li><li id="SkylinkLogger-nav"><a href="SkylinkLogger.html">SkylinkLogger</a><ul class='methods'><li data-type="method" id="SkylinkLogger-disableAll-nav"><a href="SkylinkLogger.html#disableAll">disableAll</a></li><li data-type="method" id="SkylinkLogger-enableAll-nav"><a href="SkylinkLogger.html#enableAll">enableAll</a></li><li data-type="method" id="SkylinkLogger-setLevel-nav"><a href="SkylinkLogger.html#setLevel">setLevel</a></li></ul></li></ul><h3>Namespaces</h3><ul><li id="Reconnection-nav"><a href="Reconnection.html">Reconnection</a></li><li id="SkylinkConstants-nav"><a href="SkylinkConstants.html">SkylinkConstants</a></li><li id="SkylinkEvents-nav"><a href="SkylinkEvents.html">SkylinkEvents</a></li></ul><h3 id="global-nav">Global</h3><ul><li><a href="global.html#AdapterJS">AdapterJS</a></li><li><a href="global.html#io">io</a></li></ul>
</nav>

<div id="main">
Expand Down
Loading

0 comments on commit 3b0c053

Please sign in to comment.