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 Pre-caching next video using CacheUtil.cache, will it slow down current video's download? #5748

Closed
marcochin opened this issue Apr 11, 2019 · 3 comments
Assignees
Labels

Comments

@marcochin
Copy link

[REQUIRED] Searched documentation and issues

[REQUIRED] Question

I want to use the CacheUtil.cache() to cache the next video, but worry that it may slow down the current playing video's download. Went through a couple docs, but still wasn't sure how CacheUtil.cache() would affect it. Is ExoPlayer smart enough to pre-cache during an optimized time? or is that something we have to implement?

I saw in another issue that PriorityTaskManager might be a clue to prioritize playback over caching is that correct? If so, are there any tutorials or docs about PriorityTaskManager. Is there a standard for how/when we should use CacheUtil.cache() so it won't slow down the current playing video's download?

Thanks.

@marcochin marcochin changed the title When Pre-caching next video using CacheUtil.cache, will it slow down current video's playback? When Pre-caching next video using CacheUtil.cache, will it slow down current video's download? Apr 11, 2019
@erdemguven erdemguven self-assigned this Apr 11, 2019
@erdemguven
Copy link
Contributor

That's correct, you need to use the same PriorityTaskManager instance for your playback and caching. When the priorities set right, it should make the download paused during buffering and continue afterwards. You can check ProgressiveDownloader code to see how it is done or ideally you can just use DownloadManager so it will handle the priorities for you.

@marcochin
Copy link
Author

marcochin commented Apr 11, 2019

Thanks, I'll look into it. Do you also know if CacheUtil.cache() checks storage space before caching? or what happens if there isn't enough storage space?

Edit: Nvm found my answer. If I use NoOpCacheEvictor I guess I'll have to manage the size myself as opposed to using a LeastRecentlyUsedCacheEvictor when creating my SimpleCache instance,

@erdemguven
Copy link
Contributor

That's correct.

@google google locked and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants