Video Streaming

BitTorrent DNA can be used to stream video files (HTTP progressive downloads) to media players (such as an embedded SWF flash player) by one of the following three integration methods:

  1. DNA Downloader - Video Player
  2. JavaScript API
  3. ActionScript API

1. DNA Downloader - Video Player

The DNA Video Player integration method involves using an embeddable SWF flash player, provided by BitTorrent, which is pre-integrated to provide Progressive Download streaming of video files thru the DNA peer network.

For a more detailed description of the DNA Video Player see: DNA Video Player

2. JavaScript API

The JavaScript integration involves modifying HTML on a webpage that links to a video file by containing it within a JavaScript function call, btdna().

Example:

btdna({url:'http://my/own/video1.flv ', service:’streaming’})

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: Streaming Service to a Web Browser – JavaScript

3. ActionScript API

The ActionScript Integration is a more advanced method of integrating DNA functionality directly into an existing flash player to enable progressive video downloads.  The ActionScript Integration involves incorporating a new class into your flash video player ActionScript file and using a new BTNetStream() function call.

The ActionScript Integration performs all the same functions as the JavaScript Integration, namely, detecting if DNA is installed on end users’ computers, and if so reforming URLs to use the DNA client in order to download content.  There is no need to use both ActionScript and JavaScript integration methods together.  The advantage of using the ActionScript Integration is that no modification is required to webpage HTML; all integration change is contained within the SWF flash video player.  Limiting integration modification to a single component is advantageous for websites with a large number of pages that all make use of the same flash player.

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