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

What is the recommended maximum number of ExoPlayer instances that can be created safely in an Android application? #1880

Open
Luke830 opened this issue Nov 13, 2024 · 1 comment
Assignees
Labels

Comments

@Luke830
Copy link

Luke830 commented Nov 13, 2024

I'm interested in understanding the maximum recommended limit for creating multiple ExoPlayer instances within an Android application. Given that each instance uses significant resources like memory and decoder capacity, is there a general guideline or known maximum for the number of ExoPlayer instances that can be created safely without affecting app stability across various devices?

The purpose of creating multiple instances of ExoPlayer is to play multiple videos simultaneously, and the only way to do this is to create multiple ExoPlayer instances.

Any insights or recommendations would be greatly appreciated.

@marcbaechinger
Copy link
Contributor

There isn't a good way to find this I'm afraid. It depends on many factors and specifically on the device you are using.

Besides the device, the reason is that an app is sharing codec resources with other apps. It can well be that you can create N codec instanced at time T, but then at T' you can create less instances because another app is using an instance already. It also is related to what media is played, so if you are playing a high quality video already you may be able to get a second instance for a low resolution video but not for another high-res video.

There is getMaxNumberOfInstances() but its JavaDoc says pretty much what I say above (or vice versa).

The above relates to HW backed (video) codecs that are limited in this way. Audio codecs are in software, so there is probably less of an issue if you want to have many players for audio playback only.

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

No branches or pull requests

2 participants