INNER CODE UNIT · JavaScript
init
webtorrent/instant.io · client/index.js:50
function init () {
if (!WebTorrent.WEBRTC_SUPPORT) {
util.error('This browser is unsupported. Please use a browser with WebRTC support.')
}
// For performance, create the client immediately
getClient(function () {})
// Seed via upload input element
const upload = document.querySelector('input[name=upload]')
if (upload) {
uploadElement(upload, function (err, files) {
if (err) return util.error(err)
files = files.map(function (file) { return file.file })
onFiles(files)
})
}