MediaControllerGlue

Added in 1.1.0
Deprecated in 1.1.0

public abstract class MediaControllerGlue extends PlaybackControlGlue


A helper class for implementing a glue layer for MediaControllerCompat.

Summary

Public constructors

MediaControllerGlue(
    Context context,
    int[] fastForwardSpeeds,
    int[] rewindSpeeds
)

This method is deprecated. Deprecated in Java

Public methods

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

Drawable

This method is deprecated. Deprecated in Java

final MediaControllerCompat

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

CharSequence

This method is deprecated. Deprecated in Java

CharSequence

This method is deprecated. Deprecated in Java

long

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void
play(int speed)

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

Inherited Constants

From androidx.leanback.media.PlaybackControlGlue
static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

Inherited methods

From androidx.leanback.widget.OnActionClickedListener
abstract void

This method is deprecated. Deprecated in Java

From androidx.leanback.media.PlaybackControlGlue
void
enableProgressUpdating(boolean enable)

This method is deprecated. Deprecated in Java

PlaybackControlsRow

This method is deprecated. Deprecated in Java

PlaybackControlsRowPresenter

This method is deprecated.

PlaybackControlGlue supports any PlaybackRowPresenter, use getPlaybackRowPresenter.

int[]

This method is deprecated. Deprecated in Java

PlaybackRowPresenter

This method is deprecated. Deprecated in Java

int[]

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

boolean
onKey(View v, int keyCode, KeyEvent event)

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated.

PlaybackControlGlue supports any PlaybackRowPresenter, use setPlaybackRowPresenter.

void
setFadingEnabled(boolean enable)

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

From androidx.leanback.media.PlaybackGlue
void

This method is deprecated. Deprecated in Java

@NonNull Context

This method is deprecated. Deprecated in Java

@Nullable PlaybackGlueHost

This method is deprecated. Deprecated in Java

@Nullable List<PlaybackGlue.PlayerCallback>

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

From android.view.View.OnKeyListener
abstract boolean
onKey(View p, int p1, KeyEvent p2)

This method is deprecated. Deprecated in Java

Public constructors

MediaControllerGlue

Added in 1.1.0
Deprecated in 1.1.0
public MediaControllerGlue(
    Context context,
    int[] fastForwardSpeeds,
    int[] rewindSpeeds
)

Constructor for the glue.

Parameters
Context context
int[] fastForwardSpeeds

Array of seek speeds for fast forward.

int[] rewindSpeeds

Array of seek speeds for rewind.

Public methods

attachToMediaController

Added in 1.1.0
Deprecated in 1.1.0
public void attachToMediaController(MediaControllerCompat mediaController)

Attaches to the given media controller.

detach

Added in 1.1.0
Deprecated in 1.1.0
public void detach()

Detaches from the media controller. Must be called when the object is no longer needed.

getCurrentPosition

public int getCurrentPosition()

Returns the current position of the media item in milliseconds.

getCurrentSpeedId

public int getCurrentSpeedId()

Returns the current playback speed. When playing normally, PLAYBACK_SPEED_NORMAL should be returned.

getMediaArt

public Drawable getMediaArt()

Returns a bitmap of the art for the media item.

getMediaController

Added in 1.1.0
Deprecated in 1.1.0
public final MediaControllerCompat getMediaController()

Returns the media controller currently attached.

getMediaDuration

public int getMediaDuration()

Returns the duration of the media item in milliseconds.

getMediaSubtitle

public CharSequence getMediaSubtitle()

Returns the subtitle of the media item.

getMediaTitle

public CharSequence getMediaTitle()

Returns the title of the media item.

getSupportedActions

public long getSupportedActions()

Returns a bitmask of actions supported by the media player.

hasValidMedia

public boolean hasValidMedia()

Returns true if there is a valid media item.

isMediaPlaying

public boolean isMediaPlaying()

Returns true if media is currently playing.

next

public void next()

Goes to the next media item. This method is optional.

pause

public void pause()

Pauses the media player.

play

public void play(int speed)

Start playback at the given speed.

Parameters
int speed

The desired playback speed. For normal playback this will be PLAYBACK_SPEED_NORMAL; higher positive values for fast forward, and negative values for rewind.

previous

public void previous()

Goes to the previous media item. This method is optional.