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

14,202

Solution 1

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.)

Solution 2

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

Share:
14,202
Volter
Author by

Volter

Updated on June 12, 2022

Comments

  • Volter
    Volter almost 2 years

    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.

  • JasonWoof
    JasonWoof about 8 years
    note that this does not use the bittorrent protocol. Though there may be clients that support both the webtorrent protocol and the bittorrent protocol.