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
path: root/bin
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2014-10-25 10:05:38 +0400
committerFeross Aboukhadijeh <feross@feross.org>2014-10-25 10:05:38 +0400
commitb6a970372be69d349750073cdee7c3549eee9016 (patch)
tree0ea06fc6fe6d5f7b821b8becf20d68808549a7ce /bin
parentfd0f6a624445e598054b1e43ef2d7a2c1cb6c7c0 (diff)
make airplay, chromecast, and xmbc module optional
To fix this build failure https://travis-ci.org/feross/webtorrent/builds/38995729
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index f40d512..69711bf 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -1,7 +1,5 @@
#!/usr/bin/env node
-var airplay = require('airplay-js')
-var chromecast = require('chromecast-js')
var clivas = require('clivas')
var cp = require('child_process')
var fs = require('fs')
@@ -11,7 +9,6 @@ var networkAddress = require('network-address')
var path = require('path')
var prettysize = require('prettysize')
var WebTorrent = require('../')
-var xbmc = require('nodebmc')
process.title = 'WebTorrent'
@@ -240,11 +237,8 @@ function onReady () {
}
})
-
- if (server)
- var href = 'http://' + networkAddress() + ':' + server.address().port + '/' + index
-
var cmd, player
+ var href = 'http://' + networkAddress() + ':' + argv.port + '/' + index
var playerName = argv.airplay ? 'Airplay'
: argv.chromecast ? 'Chromecast'
: argv.xbmc ? 'XBMC'
@@ -295,6 +289,7 @@ function onReady () {
}
if (argv.airplay) {
+ var airplay = require('airplay-js')
airplay.createBrowser()
.on('deviceOn', function (device) {
device.play(href, 0, function () {})
@@ -304,7 +299,8 @@ function onReady () {
}
if (argv.chromecast) {
- ;(new chromecast.Browser())
+ var chromecast = require('chromecast-js')
+ new chromecast.Browser()
.on('deviceOn', function (device) {
device.connect()
device.on('connected', function () {
@@ -314,7 +310,8 @@ function onReady () {
}
if (argv.xbmc) {
- ;(new xbmc.Browser())
+ var xbmc = require('nodebmc')
+ new xbmc.Browser()
.on('deviceOn', function (device) {
device.play(href, function () {})
})