diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-01-02 16:26:14 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-01-02 16:26:14 +0300 |
commit | 0130530ca338b8329983fd2ac766a0a7b556c94f (patch) | |
tree | 3f141ce69a8a430bdc968ed5012bf0bf5243a22f /index.js | |
parent | e36e0d50909e698e31633a584bf1792b3bc523cf (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.js | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |