Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCas <6506529+ThaUnknown@users.noreply.github.com>2022-02-03 23:53:41 +0300
committerDiego Rodríguez Baquero <diego@mothership.com>2022-02-04 00:06:09 +0300
commit69bdd93bdbe64ab9cc2c22e700560ecea02645e2 (patch)
treeb8b3e52a6121f0ae7037f74f0ef4fe6cf6094e01 /docs
parent8449ea0900d409a3cec638b28ec496f861f06622 (diff)
fix: getStreamURL docs (#2257)
Diffstat (limited to 'docs')
-rw-r--r--docs/api.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/api.md b/docs/api.md
index 1597707..1802d65 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -248,6 +248,8 @@ use the whole bandwidth of the connection.
Accepts an existing service worker registration [navigator.serviceWorker.controller] which must be activated, "creates" a file server for streamed file rendering to use.
+Needs either [this worker](https://github.com/webtorrent/webtorrent/blob/master/sw.min.js) to be used, or have [this functionality](https://github.com/webtorrent/webtorrent/blob/master/lib/worker.js) implemented.
+
# Torrent API
## `torrent.name`
@@ -797,12 +799,12 @@ Support table:
## `file.getStreamURL(elem, [function callback (err, elem) {}])` *(browser only)*
-Requires `client.loadWorker` to be ran beforehand. Sets the element source to the file's streaming URL.
+Requires `client.loadWorker` to be ran beforehand.
This method is useful for creating a file download link, like this:
```js
-file.getBlobURL((err, url) => {
+file.getStreamURL((err, url) => {
if (err) throw err
const a = document.createElement('a')
a.target = "_blank"