This complete HTML example mimics the UI of thewebtorrent.io homepage. It downloads thesintel.torrent file, streams it inthe browser and outputs some statistics to the user (peers, progress, remainingtime, speed...).
After using the code npm install webtorrent and just doing Ctrl + c + Ctrl + v, this example from above in tag showed up player. Magic :) But I do something in my VM and now Chrome say that the require('webtorrent') is not definied.
Simply include the webtorrent.min.js script on your page to start fetching files over WebRTC using the BitTorrent protocol, or require('webtorrent') with browserify. See demo apps and code examples below.
To seed files to web peers, use a client that supports WebTorrent, e.g. WebTorrent Desktop, a desktop client with a familiar UI that can connect to web peers, webtorrent-hybrid, a command line program, or Instant.io, a website. Established torrent clients like Vuze have already added WebTorrent support so they can connect to both normal and web peers. We hope other clients will follow.
For those interested in getting WebTorrent, you should know that in node.js, webtorrent-hybrid can download torrents from WebRTC peers or TCP peers. To install webtorrent-hybrid, just run the following command in a terminal.
df19127ead