Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I stream a video from a torrent using HTML 5?

I have an HTML 5 website where I want to stream videos from a torrent server. I don't know which Linux torrent client to use. Can I use PHP as a torrent client?

Example:

<video src="downloder.php?file=movie.mp4" 

downloader.php would then return an mp4 file from the .torrent file.

like image 252
Volter Avatar asked Apr 26 '11 19:04

Volter


2 Answers

You can use @feross' fantastic library, webtorrent. This works in both Node.js and the browser.

like image 150
Eric Martindale Avatar answered Nov 18 '22 10:11

Eric Martindale


HTML5/javascript can't do the bittorrent protocol. Java applets can, but few browsers support java applets out of the box these days. https://webtorrent.io/ is an alternate protocol that works in the browser. It can't communicate via the bittorrent protocol though, so only works with webtorrent trackers (and piers that speak webtorrent.)

like image 1
JasonWoof Avatar answered Nov 18 '22 10:11

JasonWoof