diff options
author | Cas <6506529+ThaUnknown@users.noreply.github.com> | 2022-02-03 23:53:41 +0300 |
---|---|---|
committer | Diego RodrÃguez Baquero <diego@mothership.com> | 2022-02-04 00:06:09 +0300 |
commit | 69bdd93bdbe64ab9cc2c22e700560ecea02645e2 (patch) | |
tree | b8b3e52a6121f0ae7037f74f0ef4fe6cf6094e01 /docs | |
parent | 8449ea0900d409a3cec638b28ec496f861f06622 (diff) |
fix: getStreamURL docs (#2257)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api.md | 6 |
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" |