mafintosh / torrent-stream

The low level streaming torrent engine that peerflix uses
MIT License
1.94k stars 227 forks source link

How do I stream the torrent to an HTML5 video tag in this ? #123

Closed lprimeroo closed 9 years ago

lprimeroo commented 9 years ago

I need to stream a movie to an html5

josejuanqm commented 9 years ago

There are like 2 other questions here regarding this topic but I got an idea that does not uses peerflix, although maybe it has to be used... anyway i was thinking in using express to share the file via a localhost so that way we can send the file to a player like webchimera or into a simple html5 video tag (which is not convenient due to codec support) the problem with this is that the file cannot be used by several apps/modules, and that conflicts with the idea of sharing the file via express.. because you cannot use the file unless torrent-stream has finished using it.... so technically it wouldn't be streaming and more like.. hey wait till it downloads so you can use it....

sorry for my English i hope you get the idea and maybe someone or you can help me.

josejuanqm commented 9 years ago

i manage to get it working only with peerflix, made a child_process and redirected to localhost where the streaming piped from the cmd. make sure you don't specify where to pipe it to.. eg: "peerflix magnet:?..." that way peerflix throws the stream to localhost and doesn't open any other apps.

one issue i encounter was that because peerflix is not an executable file i couldn't use it with spawn child process. so we're not getting stdout

Edit: can run peerflix in spawn process via node, running app.js inside the module so, now we get output

jaruba commented 9 years ago

Hey @saru95 , could you please close this issue, it has been discussed and solved here: https://github.com/mafintosh/peerflix/issues/211

@josejuanqm please check out the thread I linked, you should not use child_process to do this, also, using express is the same as making a streaming server as peerflix does.

josejuanqm commented 9 years ago

great @jaruba thanks!