From 69bdd93bdbe64ab9cc2c22e700560ecea02645e2 Mon Sep 17 00:00:00 2001 From: Cas <6506529+ThaUnknown@users.noreply.github.com> Date: Thu, 3 Feb 2022 21:53:41 +0100 Subject: fix: getStreamURL docs (#2257) --- docs/api.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs') 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" -- cgit v1.2.3