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

More info #1797

Open
bystefu opened this issue Dec 27, 2019 · 1 comment
Open

More info #1797

bystefu opened this issue Dec 27, 2019 · 1 comment

Comments

@bystefu
Copy link

@bystefu bystefu commented Dec 27, 2019

Hello, i'm new in webtorrent and javascript.I have some questions,maybe what i ask is already maked,apologize for that.

So, i use webtorrent for browser and i want to know if is any way to pause the downloading of torrent when the progress is more e.g 30%, because i'm not sure if user continue watching to the end.If mp4 video has one hour,maybe in 10 minutes torrent will be complete loaded,and user give up on 15 minutes after.I say that because and 80% from users use data network,and has a GB limit in Europe.

If continue watching, i want to resume the torrent.

Also, i want to know if i can put a limit to speed of upload/download.

@carlos-menezes

This comment has been minimized.

Copy link

@carlos-menezes carlos-menezes commented Jan 4, 2020

You could use torrent.on('download', function (bytes) {}) (see). Then, you have access to torrent.progress, which returns the torrent's download progress, from 0 to 1 --- you'd have to check if torrent.progress >= 0.30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

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