mafintosh / peerflix

Streaming torrent client for node.js
MIT License
6.17k stars 674 forks source link

browserify #100

Open Bit451 opened 9 years ago

Bit451 commented 9 years ago

Is anyone aware of a browserified fork of peerflix, or are there any plans to incorporate something like this? Thanks in advance!

mafintosh commented 9 years ago

Have you checked out webtorrent by @feross?

feross commented 9 years ago

@mafintosh you beat me to it :)

@Bit451 BitTorrent opens TCP and UDP connections, which is disallowed in web browsers for security reasons. It's not possible to browserify a bittorrent implementation in javascript and have it work in the browser without significant changes.

However, I'm working on just such a project. See WebTorrent. It uses WebRTC instead of TCP and UDP sockets and works in both node and the browser. It reuses many of peerflix's dependencies. It's pre-alpha, in the sense that it doesn't work yet and I haven't yet pushed most of the WebRTC-related code yet. But, it's getting close :) This is the project to keep your eye on! Or, help build, if you're so inclined!

Bit451 commented 9 years ago

Thanks for the heads up! @feross is there any approximate timetable on when some of that code will be pushed and an alpha or beta version will be released?

feross commented 9 years ago

@Bit451 No timetable, unfortunately. I'm working as fast as I can, but I have a full-time job so it's hard to make reliable progress. It comes in bursts and spurts.

Bit451 commented 9 years ago

@feross ah, totally understand, just didn't know if you might've had any rough dates in mind. Thanks for the project, can't wait to see it come to fruition!

ortix commented 9 years ago

@feross I'm curious then how btapps.js works? I'm trying to create a browser streaming implementation

feross commented 9 years ago

btapp.js is a plugin (like flash) that very few users will have installed. If you're comfortable making users install a plugin to use your website, then you can use that today. Also, I'm not sure if the plugin exposes the torrented files to the browser environment so you can display it in your site.

jaruba commented 9 years ago

You will need a plugin installed for this.

Check out: Powder NPAPI Plugin

It also has a demo of it streaming torrents directly on a GitHub page. ;)

omgbox commented 9 years ago

Web Chimera Plug-in has no support for Linux yet, it works only on windows and mac. found a torrent streaming client written for firefox , check the code might be helpful somehow sockets.js

https://addons.mozilla.org/en-US/firefox/files/browse/298232/file/resource/TCPSocket.js#top

Torrent Tornado 2.05 https://github.com/mafintosh/peerflix/issues/100#

jaruba commented 9 years ago

@omgbox WebChimera Plugin does not stream torrents, it's a web player based on libvlc.dll.

It offers versions for Windows and Mac on the download page and also a way to build it on Linux, but on Linux it's still very new and lacking some features.

Powder NPAPI is the Peerflix Interface for the browser that "streams the torrents" (currently only made it for windows) that can be used in combination with ANY WEB PLAYER that supports the required video types (VLC Web Player, Divx Web Player, etc) The cool thing about using WebChimera as the player is that it also supports a playlist and external subtitles.

Powder NPAPI should be easy to port to Mac and Linux as it is a very basic Plugin that simply communicates with Peerflix through the command line and then passes the data to the browser page. But personally I have to many projects these days (including being one of the developers for the WebChimera Project) to have time to port it to other OS's.