Age | Commit message (Collapse) | Author |
|
In Node.js 8.2.1, when a torrent is removed while a file from it is being
streamed, file-stream.js exits, crashing Node with a TypeError:
VM535 file-stream.js:64 Uncaught TypeError: Cannot read property 'get' of null
This patch checks whether the torrent has been marked as destroyed, and
if so, raises the error to the file stream.
|
|
|
|
|
|
|
|
|
|
`render-media` and `videostream` may get passed an `end` value that’s
too large. Clamp it.
|
|
|
|
|
|
|
|
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.
|
|
|
|
# Removed API `file.createReadStream().pipe(videoNode)`
Previously, the `stream.pipe` method was overridden in a non-standard
and confusing way to be able to pipe to `<video>` and `<audio>` tags.
This is removed now. `stream.pipe` still exists, but it works just like
in node now.
# New API: `file.appendTo(rootElem, function callback (err, elem) {})`
Show the file in a the browser by appending it to the DOM. This is a
powerful function
that handles many file types like video (.mp4, .webm, .m4v, etc.),
audio (.m4a, .mp3,
.wav, etc.), images (.jpg, .gif, .png, etc.), and other file formats
(.pdf, .md, .txt,
etc.).
The file will be fetched from the network with highest priority and
streamed into the
page (if it's video or audio). In some cases, video or audio files will
not be streamable
because they're not in a format that the browser can stream so the file
will be fully downloaded before being played. For other non-streamable
file types like images and PDFs,
the file will be downloaded then displayed.
`rootElem` is a container element (CSS selector or reference to DOM
node) that the content
will be shown in. A new DOM node will be created for the content and
appended to
`rootElem`.
`callback` will be called once the file is visible to the user.
`callback` must be
specified, and will be called with a an `Error` (or `null`) and the new
DOM node that is
displaying the content.
```js
file.appendTo('#containerElement', function (err, elem) {
if (err) throw err // file failed to download or display in the DOM
console.log('New DOM node with the content', elem)
})
```
Fixes #370
|
|
|
|
|
|
|
|
|
|
cc @jhiesey
|
|
also, fixed a bug with choking where we were inspecting wire._destroyed
instead of wire.destroyed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
close #144
|
|
When I started the WebTorrent project I thought there were going to
need to be two separate client implementations (bittorrent-client and
webtorrent-client) that would get tied together in a higher-level
module.
Fortunately, this was not necessary because of the awesome “browser”
field support in browserify. By substituting just a few modules, we can
make the same module (webtorrent) work in node AND the browser, with
the same codebase!
So, from now on, you can just `require(‘webtorrent’)` in node or the
browser, and it will just work. You can also `npm install webtorrent`
if you want to use bittorrent in a node app or script. Lastly, you can
`npm install webtorrent -g` if you want to use webtorrent as a command
line app (it installs a `webtorrent` command).
|