INNER CODE UNIT · JavaScript
seed
webtorrent/instant.io · client/index.js:165
function seed (files) {
if (files.length === 0) return
util.log('Seeding ' + files.length + ' files')
// Seed from WebTorrent
getClient(function (err, client) {
if (err) return util.error(err)
client.seed(files, onTorrent)
})
}
function onTorrent (torrent) {
torrent.on('warning', util.warning)
torrent.on('error', util.error)
const upload = document.querySelector('input[name=upload]')
upload.value = upload.defaultValue // reset upload element