Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Request: Embedded Webtorrent HOW-TO (as found on webtorrent.io) #876

Closed
jrnolan2525 opened this issue Jul 28, 2016 · 6 comments
Closed
Labels

Comments

@jrnolan2525
Copy link

@jrnolan2525 jrnolan2525 commented Jul 28, 2016

Hello & thank you for such an exciting technology.

How would one demonstrate a single-page setup as found on https://webtorrent.io's embedded stream, including those lovely progress & speed indicators? I've used the Quick Example's 'Downloading a torrent (in the browser)' as found on https://webtorrent.io/intro but I would be interested in seeing the dynamic resize as demostrated.

My skill level: QBasic is still vogue, yes? That said, I did manage to get Node.js & NPM installed though I'm using webtorrent.min.js as preference for dependency mitigation.

TIA.

@jrnolan2525 jrnolan2525 changed the title Feature Request: Embedded Webtorrent as on webtorrent.io HOW-TO Documentation Request: Embedded Webtorrent (as found on webtorrent.io) HOW-TO Jul 28, 2016
@jrnolan2525 jrnolan2525 changed the title Documentation Request: Embedded Webtorrent (as found on webtorrent.io) HOW-TO Documentation Request: Embedded Webtorrent HOW-TO (as found on webtorrent.io) Jul 28, 2016
@yciabaud

This comment has been minimized.

Copy link
Contributor

@yciabaud yciabaud commented Jul 28, 2016

Hello jrnolan2525,

I have set a codepen up for you with some of the styles and the status.

Basically, you need to trigger a function to refresh the status using the torrent API. In the example, a onProgress function is triggered periodically after the ontorrent event and the HTML elements are refreshed with torrent.progress, torrent.numPeers, torrent.downloaded, torrent.length and torrent.timeRemaining.

Is that what you expected?

@jrnolan2525

This comment has been minimized.

Copy link
Author

@jrnolan2525 jrnolan2525 commented Jul 28, 2016

Bonjour Mon Ami -

I am gobsmacked. Stunning; absolutely stunning how elegant & impactful of your work. To say the very least, it brings clarity to many of the points of confusion I'm grappling.

I assume it's safe to delete these entries fr codepen:

@yciabaud

This comment has been minimized.

Copy link
Contributor

@yciabaud yciabaud commented Jul 28, 2016

Oh that is codepen stuff, all you really need besides the JS code showed in the window is the webtorrent and moment.js dependencies. (moment.js is used to print human readable remaining time)

In the head:

<script src="https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js"></script>
<script src="http://momentjs.com/downloads/moment.min.js"></script>

You can try the export as zip feature from codepen and you will have a working static page to load locally without any codepen stuff to bother with.

You definitely can use a magnet link in the webtorrent client, the torrent link is informative but you can set the magnet link in the href.

Remember the torrent needs to be seeded in the webtorrent network (like instant.io)

Regards,

@feross feross added the question label Jul 30, 2016
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jul 30, 2016

@yciabaud Thanks for helping out! I I'm going to add you to this repo too (in addition to bittorrent-tracker, etc.) so you can help out with issues 👍

Also, if you have time, can you add your example to docs/get-started.md?

@feross feross closed this Jul 30, 2016
@yciabaud

This comment has been minimized.

Copy link
Contributor

@yciabaud yciabaud commented Jul 30, 2016

Sure I will.

@lock

This comment has been minimized.

Copy link

@lock 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.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.