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

How to actually use PreloadManager #2165

Open
k-arabadzhiev opened this issue Feb 19, 2025 · 3 comments
Open

How to actually use PreloadManager #2165

k-arabadzhiev opened this issue Feb 19, 2025 · 3 comments

Comments

@k-arabadzhiev
Copy link

I couldn't find much documentation on PreloadManager and how to use it.

I found this article
https://medium.com/google-exoplayer/media3-1-4-0-whats-new-ba1c9c17ee1a
when preload manager was introduced.

I know there's the shortform demo which uses PreloadManager, but the demo itself seems more complicated than it should be. It's using multiple players and I'm failing to understand why.

The article above metions:

Media3 ExoPlayer now supports preloading multiple media items to memory before adding them to the player, thanks to the new PreloadManager.

To me this sounds like it should be possible to have shorts preloading even with a single player, but maybe I'm missing something and there's a good explanation why the demo is using multiple players.

My end goal is to have smooth transition between short videos in view pager.

@tonihei
Copy link
Collaborator

tonihei commented Feb 21, 2025

@tianyif Could you take a look?

We are also planning to publish more permanent guidelines on developer.android.com that should help answer that kind of issue.

@k-arabadzhiev
Copy link
Author

@tonihei Thanks for looking at this! Can you give any time frame about the documentation or give a bit more in sight about the multi-player strategy now. I don't want to be writing something that will potentially end up as technical debt in 2 weeks for example.

@MayuriKhinvasara
Copy link

Hello.

Thanks for the question.
Yes, the PreloadManager should you give the ability to use a single exoplayer instance and preload multiple items as per your choice.

You can also customize the number of videos, duration for each and ranking for preload per video.

Check the Sample here android/socialite#91
with a single exoplayer instance doing this all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants