Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upImprove docs #694
Improve docs #694
Conversation
Change magnetURI to torrentId to avoid confusing, because client.add is not limited only to magnet URIs and there are many ways to define torrentId, e.g. HTTP(S) URL to a *.torrent file.
Use complete magnet URI to keep example working, because trackerless magnet URIs are not supported in web browser environment (at least at this moment).
Add missing port variable.
Change magnetURI to torrentId to avoid confusing, because client.add is not limited only to magnet URIs and there are many ways to define torrentId, e.g. HTTP(S) URL to a *.torrent file.
Use real magnet URI to keep example working.
Remove concrete ways of install and use modules from examples for browser environment.
Change magnetURI to torrentId to avoid confusing, because client.add is not limited only to magnet URIs and there are many ways to define torrentId, e.g. HTTP(S) URL to a *.torrent file.
Use real magnet URI to keep example working.
Remove concrete ways of install and use modules from examples for browser environment.
Fix broken link and add all available ways to specify a torrent directly to the page.
| var client = new WebTorrent() | ||
| var magnetURI = '...' | ||
| var torrentId = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&tr=wss%3A%2F%2Ftracker.webtorrent.io&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel-1024-surround.mp4' |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
FluorescentHallucinogen
Mar 25, 2016
Author
Contributor
Please look at client.add API: client.add(torrentId, [opts], [function ontorrent (torrent) {}])
Every magnet URI is torrent id. But not every torrent id is magnet URI.
torrentId can be one of:
- magnet uri (string)
- torrent file (buffer)
- info hash (hex string or buffer)
- parsed torrent (from parse-torrent)
- http/https url to a torrent file (string)
- filesystem path to a torrent file (string)
E.g. you can change
var magnetURI = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d'
to
var magnetURI = 'https://webtorrent.io/torrents/sintel.torrent'
in this example and the resulting code will still work, bacause torrentId argument of client.add is not limited only to magnet URIs, but in this case using magnetURI as a name of variable is not a good idea, because actually it is not a magnet URI, it is URL to *.torrent file.
This comment has been minimized.
This comment has been minimized.
|
The variable containing the magnetURI imo should stay as magnetURI, it's one of the many torrent identifiers. |
This comment has been minimized.
This comment has been minimized.
|
Some new people who absolutely unfamiliar with WebTorrent might think that magnet URI is the only way to specify torrent in this example. I've changed the name of variable
|
This comment has been minimized.
This comment has been minimized.
|
@feross, please look at this pull request. |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the suggested doc improvements! I've merged some of your changes in this commit e3803dd but the others didn't make sense to me. Thanks again! |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
May 4, 2018
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
FluorescentHallucinogen commentedMar 25, 2016
No description provided.