From 6b2b9d214f5b960a6b3dbc9f4974afdd926a6aae Mon Sep 17 00:00:00 2001 From: Patineta Date: Fri, 21 Feb 2014 20:05:05 -0300 Subject: [PATCH 001/436] A couple of changes for peerflix (fixed port and uses 127.0.0.1) Added all the node_modules so we don't hape to setup each one. Also updated peerflix dependencies to the latest bittorrent version. --- js/app.js | 10 ++++++---- js/frontend/app.js | 2 +- package.json | 1 - 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js/app.js b/js/app.js index 24181fa7..4fa5a058 100644 --- a/js/app.js +++ b/js/app.js @@ -108,10 +108,9 @@ win.on('close', function() { } }); + // Taken from peerflix `app.js` -var peerflix = require('peerflix'), - child_process = require('child_process'), - address = require('network-address'); +var peerflix = require('peerflix'); var videoPeerflix = null; var playTorrent = window.playTorrent = function (torrent, subs, callback, progressCallback) { @@ -131,9 +130,12 @@ var playTorrent = window.playTorrent = function (torrent, subs, callback, progre tmpFilename = tmpFilename.replace(/([^a-zA-Z0-9-_])/g, '_') +'-'+ (new Date()*1) +'.mp4'; var tmpFile = path.join(tmpFolder, tmpFilename); + + // Start Peerflix videoPeerflix = peerflix(torrent, { // Set the custom temp file path: tmpFile, + port: 554, buffer: (1.5 * 1024 * 1024).toString() }, function (err, flix) { if (err) throw err; @@ -142,7 +144,7 @@ var playTorrent = window.playTorrent = function (torrent, subs, callback, progre loadedTimeout; flix.server.on('listening', function () { - var href = 'http://' + address() + ':' + flix.server.address().port + '/'; + var href = 'http://127.0.0.1:' + flix.server.address().port + '/'; loadedTimeout ? clearTimeout(loadedTimeout) : null; diff --git a/js/frontend/app.js b/js/frontend/app.js index 8c44c12f..f4808052 100644 --- a/js/frontend/app.js +++ b/js/frontend/app.js @@ -52,7 +52,7 @@ window.spawnCallback = function (url, subs) { } var player = - '