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

Aborting In-Progress Video Segment Downloads #7337

Closed
aadharjain1 opened this issue Sep 18, 2024 · 4 comments
Closed

Aborting In-Progress Video Segment Downloads #7337

aadharjain1 opened this issue Sep 18, 2024 · 4 comments
Labels
type: question A question from the community

Comments

@aadharjain1
Copy link

Have you read the Tutorials?
Yes

Have you read the FAQ and checked for duplicate open issues?
Yes

If the question is related to FairPlay, have you read the tutorial?

Not related

What version of Shaka Player are you using?
4.11.0

What browser and OS are you using?
Android Webview & Chrome

Please ask your question
I have an infinite video feed (m3u8 videos) and I start loading a video once it comes into focus. If user scrolls through videos really fast, then 1st video segment of all the videos start downloading parallely and choke the network bandwidth, resulting in delay in playing current focused video. As a possible solution, I would like to know if there's a way to abort the download of in progress video segments, if user moves to next video. As of now, I'm able to stop download of any new segments, but couldn't cancel the ones which are already being downloaded.

@aadharjain1 aadharjain1 added the type: question A question from the community label Sep 18, 2024
@theodab
Copy link
Contributor

theodab commented Sep 19, 2024

Are you referring to the preload API? A preload manager should abort downloads when you call destroy on it, if it hasn't been loaded by a player yet. If it's not doing so, that's a bug.

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Sep 19, 2024
@aadharjain1
Copy link
Author

Hi @theodab, question is actually valid for both load and preload APIs. Calling destroy on preload manager currently is making fully downloaded segments unusable for future.

Scenario (Given Segment Size ~ 500kb)
User is watching Video 1 (2 segments are completely downloaded and 3rd is in progress)
User moves to Video 2 (1st segment starts downloading)

I'm looking for a way to be able to cancel download for Video 1 - Segment 3, so that user's bandwidth can be dedicated in loading Video 2. But in case user comes back to Video 1, we should be able to play already downloaded segments of Video 1 instantly.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Sep 20, 2024
@joeyparrish
Copy link
Member

You can:

  1. pause() the video - the player will stop fetching when it reaches the buffering goal
  2. unload() the player - the player will stop immediately, and you have to call load() again to resume the content

Does this help?

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Sep 23, 2024
@shaka-bot
Copy link
Collaborator

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question A question from the community
Projects
None yet
Development

No branches or pull requests

5 participants