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

When player is active, other downloads should temporarily stop #362

Closed
feross opened this issue Apr 8, 2016 · 11 comments
Closed

When player is active, other downloads should temporarily stop #362

feross opened this issue Apr 8, 2016 · 11 comments

Comments

@feross
Copy link
Member

feross commented Apr 8, 2016

So all download capacity goes to what the user actually wants to see.

@ungoldman
Copy link
Contributor

Disagree! At least for me that is not desirable.

@rom1504
Copy link
Member

rom1504 commented Apr 8, 2016

Maybe there could be an option in the preferences window #144

@karloluis
Copy link
Contributor

Maybe throttle the rest? This really puts more stress on the preferences issue, specially since the goal is to keep it minimal.

@ungoldman
Copy link
Contributor

I think a pause all button would be a good feature, would leave the
decision of how to manage downloads and streaming to the user.
On Mon, Apr 11, 2016 at 9:44 AM Karlo Luis Martinez Martos <
notifications@github.com> wrote:

Maybe throttle the rest? This really puts more stress on the preferences
issue, specially since the goal is to keep it minimal.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#362 (comment)

@dcposch
Copy link
Contributor

dcposch commented Apr 20, 2016

I think we can solve this with a global priority for pieces to download, across all active torrents.

While you're streaming, pieces within a few megabytes of where you're currently playing should get top priority. That way, your media should never pause to buffer as long as your internet connection (and the seeders) are fast enough.

Pieces that are far ahead of where you're currently playing can have the same priority as other torrents running in the background.

@feross thoughts?

@ungoldman to your point, I think this could be more elegant than just pausing all other torrents while one is streaming. At the same time you never want to your video to buffer because other torrents are taking up too much bandwidth

@feross
Copy link
Member Author

feross commented Apr 23, 2016

@dcposch This issue isn't really about piece selection priority as much as throttling. Piece selection priority affects what pieces we ask peers for next. Each torrent currently asks as fast as it can, based on the measured connection speeds, always asking for a little bit more data than the peer is currently sending.

Each torrent object in WebTorrent is isolated. One torrent object doesn't know anything about another. So, to solve this issue correctly, we need to add per-torrent throttling and a notion of torrent priority to WebTorrent.

We can probably devise a balanced solution where priority for the background torrents increases as the foreground torrent builds up a buffer. But this is a non-trivial change.

In the meantime, I propose we do the right thing for 99% of users, and that is to make sure streaming works reliably.

Steam does this too. When you launch a game, all game downloads pause so the foreground game can use 100% of the available bandwidth.

That model makes sense for WebTorrent too. When the active torrent is not fully downloaded, the full bandwidth should be made available to it. Once it completes, the background torrent downloads can resume. Also, if the torrent is already completed when the playback beings, then background torrent downloading should not be interrupted.

@Moscarda
Copy link

Moscarda commented Jun 6, 2016

@agree with those who've said it should be a user-specified preference. Nobody likes torrent clients taking basic things like handling bandwidth out of the hands of the user. That said, perhaps something could be done to improve the efficacy of streaming content, for example not all content loads chronologically yet, which hinders smooth streaming.

@feross
Copy link
Member Author

feross commented Jun 6, 2016

@Moscarda Adding user-controlled bandwidth throttling is a planned feature :)

@codealchemist
Copy link
Contributor

I've got something already working on #840 which matches @feross description to satisfy 99% of the users.

Cheers!

@augnustin
Copy link

I'd say it shall rely on how much buffer is available on the active one, but if little, sounds like it makes sense!

@bnjmnt4n
Copy link
Member

Closing since #840 was merged. 🎉

@lock lock bot locked as resolved and limited conversation to collaborators May 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants