You can obtain the current DecoderVideoRenderer in Android ExoPlayer 2 by accessing the Renderer array of the ExoPlayer instance and filtering for DecoderVideoRenderer instance type:
// Obtain ExoPlayer instance
ExoPlayer exoPlayer = getPlayer();
// Retrieve Renderer array from ExoPlayer instance
Renderer[] renderers = exoPlayer.getRenderers();
// Filter Renderer array for DecoderVideoRenderer instance type
for (Renderer renderer : renderers) {
if (renderer instanceof DecoderVideoRenderer) {
DecoderVideoRenderer videoRenderer = (DecoderVideoRenderer) renderer;
// videoRenderer now contains the current DecoderVideoRenderer instance
break;
}
}
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-02-16 11:00:00 +0000
Seen: 7 times
Last updated: Aug 12 '22
What does "terminate called after throwing an instance of 'std::out_of_range'" mean?
How can the Django post_save() signal be implemented?
What is the process for transferring image files to an AWS EC2 instance?
What is the issue with calling `jakarta.validation.Validation#buildDefaultValidatorFactory`?
How can I run the same executable as the present instance in C# without using Process.Start()?
How can the ServiceCollection be overridden in middleware?
When a fragment is destroyed, why isn't the Android ViewModel also destroyed?