Class LeanbackPlayerAdapter
- java.lang.Object
-
- androidx.leanback.media.PlayerAdapter
-
- com.google.android.exoplayer2.ext.leanback.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.LeanbackPlayerAdapter
implementation forPlayer
.
-
-
Constructor Summary
Constructors Constructor Description LeanbackPlayerAdapter(Context context, Player player, int updatePeriodMs)
Deprecated.Builds an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
getBufferedPosition()
Deprecated.long
getCurrentPosition()
Deprecated.long
getDuration()
Deprecated.boolean
isPlaying()
Deprecated.boolean
isPrepared()
Deprecated.void
onAttachedToHost(androidx.leanback.media.PlaybackGlueHost host)
Deprecated.void
onDetachedFromHost()
Deprecated.void
pause()
Deprecated.void
play()
Deprecated.void
run()
Deprecated.void
seekTo(long positionInMs)
Deprecated.void
setErrorMessageProvider(ErrorMessageProvider<? super PlaybackException> errorMessageProvider)
Deprecated.Sets the optionalErrorMessageProvider
.void
setProgressUpdatingEnabled(boolean enable)
Deprecated.
-
-
-
Constructor Detail
-
LeanbackPlayerAdapter
public LeanbackPlayerAdapter(Context context, Player player, int updatePeriodMs)
Deprecated.Builds an instance. Note that thePlayerAdapter
does not manage the lifecycle of thePlayer
instance. The caller remains responsible for releasing the player when it's no longer required.
-
-
Method Detail
-
setErrorMessageProvider
public void setErrorMessageProvider(@Nullable ErrorMessageProvider<? super PlaybackException> errorMessageProvider)
Deprecated.Sets the optionalErrorMessageProvider
.- Parameters:
errorMessageProvider
- TheErrorMessageProvider
.
-
onAttachedToHost
public void onAttachedToHost(androidx.leanback.media.PlaybackGlueHost host)
Deprecated.- Overrides:
onAttachedToHost
in classandroidx.leanback.media.PlayerAdapter
-
onDetachedFromHost
public void onDetachedFromHost()
Deprecated.- Overrides:
onDetachedFromHost
in classandroidx.leanback.media.PlayerAdapter
-
setProgressUpdatingEnabled
public void setProgressUpdatingEnabled(boolean enable)
Deprecated.- Overrides:
setProgressUpdatingEnabled
in classandroidx.leanback.media.PlayerAdapter
-
isPlaying
public boolean isPlaying()
Deprecated.- Overrides:
isPlaying
in classandroidx.leanback.media.PlayerAdapter
-
getDuration
public long getDuration()
Deprecated.- Overrides:
getDuration
in classandroidx.leanback.media.PlayerAdapter
-
getCurrentPosition
public long getCurrentPosition()
Deprecated.- Overrides:
getCurrentPosition
in classandroidx.leanback.media.PlayerAdapter
-
play
public void play()
Deprecated.- Specified by:
play
in classandroidx.leanback.media.PlayerAdapter
-
pause
public void pause()
Deprecated.- Specified by:
pause
in classandroidx.leanback.media.PlayerAdapter
-
seekTo
public void seekTo(long positionInMs)
Deprecated.- Overrides:
seekTo
in classandroidx.leanback.media.PlayerAdapter
-
getBufferedPosition
public long getBufferedPosition()
Deprecated.- Overrides:
getBufferedPosition
in classandroidx.leanback.media.PlayerAdapter
-
isPrepared
public boolean isPrepared()
Deprecated.- Overrides:
isPrepared
in classandroidx.leanback.media.PlayerAdapter
-
-