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-04-23 17:14:51 +0400
committerFeross Aboukhadijeh <feross@feross.org>2014-04-23 17:14:51 +0400
commitf1a5eabb8d5f8f15b9c2969e4cba0401fb136663 (patch)
tree2736b260dba1c2b05bab3aea8c71defcaf142c02 /bin
parentbf61a54bd87c691d6e476147b5c7d86e8868a3f6 (diff)
new constructor usage
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 6d42e4a..bb381fe 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -75,14 +75,15 @@ if (subtitles) {
MPLAYER_EXEC += ' -sub ' + subtitles
}
-var manager = new WebTorrent(torrentId, {
-
+var client = new WebTorrent({
+ list: list
})
+client.add(torrentId)
if (list) {
// TODO
- manager.on('ready', function () {
- manager.files.forEach(function (file, i, files) {
+ client.on('torrent', function (torrent) {
+ torrent.files.forEach(function (file, i) {
console.log(i, file.name)
})
process.exit(0)