
It's been observed that some devices fail when releasing a secure codec attached to a surface and immediately trying to create a new codec (secure or insecure) attached to the same surface. This change catches all exceptions thrown during codec creation, sleeps for a short time, and then retries the codec creation. This is observed to fix the problem (we believe this is because it allows enough time for some background part of the previous codec release operation to complete). This change should have no effect on the control flow when codec creation succeeds first time. It will introduce a slight delay when creating the preferred codec fails (while we sleep and retry), which will either delay propagating a permanent error or attempting to initialize a fallback decoder. We can't avoid the extra delay to instantiating the fallback decoder because we can't know whether we expect the second attempt to create the preferred decoder to succeed or fail. The benefit to always retrying the preferred decoder creation (fixing playback failures) outweighs the unfortunate additional delay to instantiating fallback decoders. Issue: google/ExoPlayer#8696 #minor-release PiperOrigin-RevId: 414671743
ExoPlayer module
This module provides ExoPlayer
, the Player
implementation for local media
playback on Android.
Getting the module
The easiest way to get the module is to add it as a gradle dependency:
implementation 'com.google.android.exoplayer:exoplayer-core:2.X.X'
where 2.X.X
is the version, which must match the version of the other media
modules being used.
Alternatively, you can clone this GitHub project and depend on the module locally. Instructions for doing this can be found in the top level README.
Using the module
The developer guide documents how to get started.