Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Fix #878.
|
|
Get a W3C `Blob` object which contains the file data.
The file will be fetched from the network with highest priority, and
`callback` will be
called once the file is ready. `callback` must be specified, and will
be called with a an
`Error` (or `null`) and the `Blob` object.
|
|
If file is destroyed and stream ends afterwards, then an exception is
thrown because self._torrent is undefined.
|
|
- Only pass `torrent.infoHash` to the Chunk Store constructor, instead
of the `Torrent`
instance itself, to prevent accidental memory leaks of the `Torrent`
object by the
store. (Open an issue if you were using other properties. They can be
re-added.)
- Non-fatal errors with a single torrent will be emitted at
`torrent.on('error')`. You
should listen to this event. Previously, all torrent errors were also
emitted on
`client.on('error')` and handling `torrent.on('error')` was optional.
This design is
better since now it is possible to distinguish between fatal client
errors
(`client.on('error')`) when the whole client becomes unusable versus
recoverable errors
where only a single torrent fails (`torrent.on('error')`) but the
client can continue to
be used. However, if there is no `torrent.on('error')` event, then
the error will be
forwarded to `client.on('error')`. This prevents crashing the client
when the user
only has a listener on the client, but it makes it impossible for
them to determine
a client error versus a torrent error.
- Errors creating a torrent with `client.seed` are now emitted on the
returned `torrent`
object instead of the client (unless there is no event listeners on
`torrent.on('error')` as previously discussed). The torrent object is
now also destroyed
automatically for the user, as was probably expected.
- If `client.get` is passed a `Torrent` instance, it now only returns
it if it is present
in the client.
|
|
|
|
Fix https://github.com/feross/webtorrent-app/issues/160
|
|
|
|
|
|
Allows selecting with a set priority, if not passed as argument, it will default to false/0
|
|
https://github.com/feross/render-media
https://github.com/feross/stream-to-blob-url
https://github.com/feross/stream-with-known-length-to-buffer
|
|
* Update 'handle' (previously 'append-to') to take a 'getElem' function
instead of directly a root element, allowing to custimize the element
injection method, and without directly manipulating the DOM.
* Reimplement 'append-to' using abstract 'handle' method.
* Implement a 'render-to' method to render a torrent inside an existing
element.
|
|
The specs say that the second Blob constructor argument is optional (http://www.w3.org/TR/FileAPI/#constructorParams), however Chrome and FF implement that differently. FF checks if the second arg is not undefined, while Chrome checks "arguments.length".
As a result, if the second argument is undefined, Chrome will throw an error (https://chromium.googlesource.com/chromium/blink/+/72fef91ac1ef679207f51def8133b336a6f6588f/LayoutTests/fast/files/blob-constructor.html#55), while FF will just ignore it.
This change makes it so that the second arg is not passed at all when it's undefined, and Chrome is happy as a result.
|
|
|
|
|
|
|
|
Part of an effort to share more code with `torrent-stream` by
@mafintosh:
https://github.com/mafintosh/torrent-stream/pull/133
https://github.com/mafintosh/torrent-stream/pull/132
Storage is now based on:
https://www.npmjs.com/package/fs-chunk-store (in node)
https://www.npmjs.com/package/memory-chunk-store (in the browser)
and:
https://www.npmjs.com/package/immediate-chunk-store
https://www.npmjs.com/package/torrent-piece
This is a BREAKING change, since users who pass in custom storage
engine with `opts.storage` will need to update their storage backend to
be `abstract-chunk-store` compliant:
https://www.npmjs.com/package/abstract-chunk-store
There are also likely other miscellaneous BREAKING API changes, since
this was a huge refactor of the codebase.
|