3. JavaScript API

The JavaScript Integration can be used for either file downloads or video progressive downloads from a web page.

The JavaScript Integration involves two steps:

  1. Loading the btdna.js JavaScript file in the header of HTML pages on your website
  2. Enclosing any URLs that link to content to be DNA-enabled inside a JavaScript function btdna().

The btdna() function detects the presence of DNA on the end user’s computer and will return a rewritten URL which uses the DNA client to access the content.  DNA will offload the content delivery using the peer network.  If DNA is not available the URL will not be rewritten and the end-user will get the content directly from the server as normal.

In this way, all end users will continue to be able to access content on your website regardless or not whether they have the DNA client installed on their computers.

For a more detailed description of the JavaScript integration method, along with sample code and API documentation see: Download Service to a Web Browser – JavaScript and Streaming Service to a Web Browser – JavaScript