Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
File.prototype.renderTo = function renderTo(rootElem, cb) {
cb = cb || function () {};
var file = {
name: `file${self._getExtension()}`,
createReadStream: function() {
return this.createReadStream();
}
};
render.render(file, rootElem, cb);
};
torrent.files.forEach(function (file) {
render.render(file, opts.selector, {autoplay: opts.autoplay});
})
})
self._store.get(0, function(e, buffer) {
if(e) { return cb(e); }
var file = {
name: `file${self._getExtension()}`,
createReadStream: function(opts) {
opts = opts || {};
return from([
buffer.slice(opts.start || 0, opts.end || (buffer.length - 1))
]);
}
};
render.render(file, rootElem, cb);
});
};
torrent.files.forEach(function (file) {
render.render(file, opts.selector, {autoplay: opts.autoplay});
})
})
renderTo (elem, opts, cb) {
if (typeof window === 'undefined') throw new Error('browser-only method')
render.render(this, elem, opts, cb)
}
File.prototype.renderTo = function (elem, opts, cb) {
cb = promisize(cb)
render.render(this, elem, opts, cb)
return cb.promise
}
componentDidUpdate() {
const { contentType, downloadCompleted } = this.props;
const { startedPlaying } = this.state;
if (this.playableType() && !startedPlaying && downloadCompleted) {
const container = this.refs.media.children[0];
if (VideoPlayer.MP3_CONTENT_TYPES.indexOf(contentType) > -1) {
this.renderAudio(this.refs.media, true);
} else {
player.render(this.file(), container, {
autoplay: true,
controls: true,
});
}
}
}