Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-01-02 16:26:14 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-01-02 16:26:14 +0300
commit0130530ca338b8329983fd2ac766a0a7b556c94f (patch)
tree3f141ce69a8a430bdc968ed5012bf0bf5243a22f /index.js
parente36e0d50909e698e31633a584bf1792b3bc523cf (diff)
New API: WebTorrent.WEBRTC_SUPPORT
Detect native WebRTC support in the environment. ```js if (WebTorrent.WEBRTC_SUPPORT) { // webrtc support! } else { // fallback } ```
Diffstat (limited to 'index.js')
-rw-r--r--index.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/index.js b/index.js
index 2281a91..6a7776a 100644
--- a/index.js
+++ b/index.js
@@ -11,12 +11,13 @@ var loadIPSet = require('load-ip-set') // browser exclude
var parallel = require('run-parallel')
var parseTorrent = require('parse-torrent')
var path = require('path')
+var Peer = require('simple-peer')
var speedometer = require('speedometer')
var zeroFill = require('zero-fill')
var Torrent = require('./lib/torrent')
-inherits(WebTorrent, EventEmitter)
+module.exports.WEBRTC_SUPPORT = Peer.WEBRTC_SUPPORT
/**
* WebTorrent version.
@@ -40,6 +41,8 @@ var VERSION_STR = VERSION.match(/([0-9]+)/g).slice(0, 2).map(zeroFill(2)).join('
*/
var VERSION_PREFIX = '-WW' + VERSION_STR + '-'
+inherits(WebTorrent, EventEmitter)
+
/**
* WebTorrent Client
* @param {Object=} opts