-
Notifications
You must be signed in to change notification settings - Fork 6k
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
SimplePool for Exoplayer #10834
Comments
Using a pool of player can make sense for some use cases. I wouldn't think about performance in the sense opf resources required to create the players. It is certainly needs a bit more resources to recreate new instances, but I would focus on performance only in the sense of user experience. That is, if you want to play two videos in a However, if you do that you need to take care of some low-level devices possibly do not support multiple instances of the video codec being used at the same time. So it gets a bit more complicated. In general I would say if there is no need in terms of user experience I would stick with a single instance for simplicity. But I think in your case it can make sense to use a pool. This is an advanced problem to solve properly and people asked question around this quite a lot. So it also makes sense to search the existing issues a bit to learn how other users solved this problem. An example issue about how to use the player in a |
Thank you for your detailed answer ! My issue is not really caused by a Let's say we have
With this simple 3-step example, the user has created and destroyed 2 instance of |
Do you have some advice ? |
I understand there is only one fragment active and only one instance playing at a time that can be shared by these fragments. I think in this case I would just have a single instance that is created in the activity, that you can use from the fragment by using |
I'm ashamed to say I didn't think of that because this is simple and brilliant. I'll go with that instead of doing a pool. Thanks |
Describe your question in detail:
Hello, my application use extensively Exoplayer and I wanted to make some improvement for my users ( ~440 000 users with phone from API 21 to API 26).
For context my app is just like Youtube, so users browse between pages which result in an ever-ending cycle of:
I was wondering if creating/releasing player is more resource-consuming than creating a Pool with 2 instances of Exoplayer? What's your opinion about using a
SimplePool<Exoplayer>(2)
?The text was updated successfully, but these errors were encountered: