diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-09-12 18:18:18 +0400 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-09-12 18:18:18 +0400 |
commit | 7c8f0a8e2352e3860a87e6a4f32ce68ee64081a5 (patch) | |
tree | d279d218d054135dd8ac78523b55fd456d3566da /bin | |
parent | ac3716d777b697d64efb9d299f2d0e8b945e3513 (diff) | |
parent | 222af0cb114c499c57053b3a08d314900737f5e9 (diff) |
Merge pull request #84 from gtuk/xbmc
Add xbmc streaming support
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cmd.js | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -2,6 +2,7 @@ var airplay = require('airplay-js') var chromecast = require('chromecast-js') +var xbmc = require('nodebmc') var clivas = require('clivas') var cp = require('child_process') var debug = require('debug')('webtorrent:cmd') @@ -40,6 +41,7 @@ var argv = minimist(process.argv.slice(2), { 'mpv', 'airplay', 'chromecast', + 'xbmc', 'list', 'no-quit', 'remove', @@ -77,6 +79,7 @@ if (argv.help || !torrentId) { --airplay stream to Apple TV (AirPlay) --chromecast stream to Chromecast + --xbmc stream to XBMC --vlc stream in VLC --mplayer stream in MPlayer --mpv stream in MPV @@ -234,6 +237,7 @@ function onTorrent (torrent) { var cmd, player var playerName = argv.airplay ? 'Airplay' : argv.chromecast ? 'Chromecast' + : argv.xbmc ? 'XBMC' : argv.vlc ? 'VLC' : argv.mplayer ? 'MPlayer' : argv.mpv ? 'mpv' @@ -299,6 +303,13 @@ function onTorrent (torrent) { }) } + if (argv.xbmc) { + ;(new xbmc.Browser()) + .on('deviceOn', function (device) { + device.play(href, function () {}) + }) + } + var hotswaps = 0 torrent.on('hotswap', function () { hotswaps += 1 |