Loading a custom version of AdapterJS is useful when you want to work with a different/modified version of AdapterJS. Modification is also required when you want to build a custom version of the screen-sharing extensions to use on your domains.


1. Linking to socket.io-client

To ensure that SkylinkJS works as expected with socket and peer connections, we recommended that you link to the corresponding version of socket.io that the version of SkylinkJS you are using has. The release notes will contain the version of socket.io-client each SkylinkJS release uses.


You can point to the socket.io CDN, as shown below. Simply replace << >> in the below snippet with the version you are intending to use.

     

<script src="//cdn.socket.io/socket.io-<< VERSION REQUIRED HERE >>.js"></script>

     


Alternatively, if you would prefer hosting this on your end, we would recommended downloading socket.io-client from here. The file name is socket.io.js in the release zip.


2. Linking to customised AdapterJS

To ensure that SkylinkJS works as expected and is updated with the correct WebRTC interface polyfills, we recommend that you link to the corresponding version of AdapterJS that the SkylinkJS version you are using, has. The release notes will contain the version of AdapterJS each SkylinkJS release uses.

 

You can point to the Temasys CDN if do not intend to make any modifications to AdapterJS. Simply replace << >> in the code-snippet shown below, with the version you would like to use.

     

<script src="//cdn.temasys.com.sg/adapterjs/<< VERSION REQUIRED HERE >>/adapter.screenshare.js"></script>

       


If you intend to modify AdapterJS,  download the file from CDN link. Simply right-click and save the file to your computer. 

[ Note : Modification is necessary if you are using a custom version of the screen-sharing extension]


If you are hosting your own version of AdapterJS, download the detectRTC.html file and add a link to your own Chrome extension. 

You will need to modify adapter.screenshare.js script file to link to your own detectRTC.html file (towards the end of the file).

   

...

// For chrome on 0.6.x, use an iframe to load the screensharing extension
// in the correct domain.
// Modify here for custom screensharing extension in chrome
if (window.webrtcDetectedBrowser === 'chrome') {
  var iframe = document.createElement('iframe');

  iframe.onload = function() {
    iframe.isLoaded = true;
  };

  iframe.src = '<< LINK To YOUR HOSTED detectRTC.html FILE >>';
  iframe.style.display = 'none';

  (document.body || document.documentElement).appendChild(iframe);

  ...

   



3. Linking to use SkylinkJS unbundled version and ordering of scripts

After you are done with setting up with your own version of SkylinkJS, make sure that all the dependencies are loaded in the order specified below:

   

<script src="linkto/socket.io.js"></script>
<script src="linkto/adapter.screenshare.js"></script>
<script src="//cdn.temasys.com.sg/skylink/skylinkjs/<< SKYLINK VERSION HERE >>/skylink.debug.js"></script>

  

You may use the compressed and production version of SkylinkJS with skylink.min.js.


Why can't skylink.complete.js be used?
Bundled versions of SkylinkJS like skylink.complete.js, contain a fixed version of AdapterJS and socket.io-client. So, you will not be able to modify the AdapterJS to use your customised version