Class LeanbackPlayerAdapter

  • All Implemented Interfaces:
    Runnable

    @Deprecated
    public final class LeanbackPlayerAdapter
    extends androidx.leanback.media.PlayerAdapter
    implements Runnable
    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.
    Leanback PlayerAdapter implementation for Player.
    • Constructor Detail

      • LeanbackPlayerAdapter

        public LeanbackPlayerAdapter​(Context context,
                                     Player player,
                                     int updatePeriodMs)
        Deprecated.
        Builds an instance. Note that the PlayerAdapter does not manage the lifecycle of the Player instance. The caller remains responsible for releasing the player when it's no longer required.
        Parameters:
        context - The current Context (activity).
        player - The Player being used.
        updatePeriodMs - The delay between player control updates, in milliseconds.
    • Method Detail

      • onAttachedToHost

        public void onAttachedToHost​(androidx.leanback.media.PlaybackGlueHost host)
        Deprecated.
        Overrides:
        onAttachedToHost in class androidx.leanback.media.PlayerAdapter
      • onDetachedFromHost

        public void onDetachedFromHost()
        Deprecated.
        Overrides:
        onDetachedFromHost in class androidx.leanback.media.PlayerAdapter
      • setProgressUpdatingEnabled

        public void setProgressUpdatingEnabled​(boolean enable)
        Deprecated.
        Overrides:
        setProgressUpdatingEnabled in class androidx.leanback.media.PlayerAdapter
      • isPlaying

        public boolean isPlaying()
        Deprecated.
        Overrides:
        isPlaying in class androidx.leanback.media.PlayerAdapter
      • getDuration

        public long getDuration()
        Deprecated.
        Overrides:
        getDuration in class androidx.leanback.media.PlayerAdapter
      • getCurrentPosition

        public long getCurrentPosition()
        Deprecated.
        Overrides:
        getCurrentPosition in class androidx.leanback.media.PlayerAdapter
      • play

        public void play()
        Deprecated.
        Specified by:
        play in class androidx.leanback.media.PlayerAdapter
      • pause

        public void pause()
        Deprecated.
        Specified by:
        pause in class androidx.leanback.media.PlayerAdapter
      • seekTo

        public void seekTo​(long positionInMs)
        Deprecated.
        Overrides:
        seekTo in class androidx.leanback.media.PlayerAdapter
      • getBufferedPosition

        public long getBufferedPosition()
        Deprecated.
        Overrides:
        getBufferedPosition in class androidx.leanback.media.PlayerAdapter
      • isPrepared

        public boolean isPrepared()
        Deprecated.
        Overrides:
        isPrepared in class androidx.leanback.media.PlayerAdapter
      • run

        public void run()
        Deprecated.
        Specified by:
        run in interface Runnable