Class SimpleBasePlayer

  • All Implemented Interfaces:
    Player

    @Deprecated
    public abstract class SimpleBasePlayer
    extends BasePlayer
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    A base implementation for Player that reduces the number of methods to implement to a minimum.

    Implementation notes:

    This base class handles various aspects of the player implementation to simplify the subclass:
    • The SimpleBasePlayer.State can only be created with allowed combinations of state values, avoiding any invalid player states.
    • Only functionality that is declared as available needs to be implemented. Other methods are automatically ignored.
    • Listener handling and informing listeners of state changes is handled automatically.
    • The base class provides a framework for asynchronous handling of method calls. It changes the visible playback state immediately to the most likely outcome to ensure the user-visible state changes look like synchronous operations. The state is then updated again once the asynchronous method calls have been fully handled.