Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to launch external media player to play torrent stream? #474

Closed
tsoernes opened this issue Oct 31, 2015 · 8 comments
Closed

How to launch external media player to play torrent stream? #474

tsoernes opened this issue Oct 31, 2015 · 8 comments

Comments

@tsoernes
Copy link

@tsoernes tsoernes commented Oct 31, 2015

Is it possible to play the torrent file in an external media player as it is being streamed? How?

var WebTorrent = require('webtorrent')

var client = new WebTorrent()
var magnetUri = '...'

client.add(magnetUri, function (torrent) {
  torrent.files.forEach(function (file) {
       // play file with vlc or mpc-hc
  })
})

Thanks

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Nov 1, 2015

You can use the command line version for that. https://github.com/feross/webtorrent#as-a-command-line-app

@tsoernes

This comment has been minimized.

Copy link
Author

@tsoernes tsoernes commented Nov 1, 2015

That won't do, unless it is possible to use command line args from inside a node js module?

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Nov 1, 2015

Why not? If I may ask. And no, at least not for webtorrent.

On Nov 1, 2015, at 4:05 PM, tsoernes notifications@github.com wrote:

That won't do, unless it is possible to use command line args from inside a node js module?


Reply to this email directly or view it on GitHub.

@tsoernes

This comment has been minimized.

Copy link
Author

@tsoernes tsoernes commented Nov 1, 2015

I get the magnet link from a web scraper written in nodejs

@gillesdemey

This comment has been minimized.

Copy link
Contributor

@gillesdemey gillesdemey commented Nov 2, 2015

You can use the torrent.createServer function to create an HTTP server that serves the torrent's contents.

https://github.com/feross/webtorrent#torrentcreateserveropts

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Nov 2, 2015

Have you looked at https://github.com/mafintosh/playback ? It has WT support

@tsoernes

This comment has been minimized.

Copy link
Author

@tsoernes tsoernes commented Nov 2, 2015

@gillesdemey Thanks, just what I needed.
@DiegoRBaquero Looks cool but it does not support the formats/codecs I need to play

Solved

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 1, 2015

Awesome – glad your issue was solved.

Thanks @gillesdemey and @DiegoRBaquero!

@feross feross closed this Dec 1, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.