Welcome to mirror list, hosted at ThFree Co, Russian Federation.

browser-download.js « examples - github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: de0cd56850c321517ee986c2a4471131b7896193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
var WebTorrent = require('webtorrent')

var client = new WebTorrent()

var torrentId = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d'

client.add(torrentId, function (torrent) {
  // Torrents can contain many files. Let's use the first.
  var file = torrent.files[0]

  // Display the file by adding it to the DOM. Supports video, audio, image, etc. files
  file.appendTo('body')
})