Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

MediaControllerAdapter

open class MediaControllerAdapter : PlayerAdapter
kotlin.Any
   ↳ androidx.leanback.media.PlayerAdapter
   ↳ androidx.leanback.media.MediaControllerAdapter

A helper class for implementing a adapter layer for MediaControllerCompat.

Summary

Public constructors

Constructor for the adapter using MediaControllerCompat.

Public methods
open Unit

open Long

open Long

open Long

open Drawable!
getMediaArt(context: Context!)

Get current media's drawable art.

open MediaControllerCompat!

Return the object of MediaControllerCompat from this class.

open CharSequence!

Get current media's subtitle.

open CharSequence!

Get current media's title.

open Long

open Boolean

open Unit

open Unit

open Unit

open Unit

open Unit

open Unit

open Unit

open Unit
seekTo(positionInMs: Long)

open Unit

open Unit
setRepeatAction(repeatActionIndex: Int)

open Unit
setShuffleAction(shuffleActionIndex: Int)

Inherited functions

Public constructors

<init>

MediaControllerAdapter(controller: MediaControllerCompat!)

Constructor for the adapter using MediaControllerCompat.

Parameters
controller MediaControllerCompat!: Object of MediaControllerCompat..

Public methods

fastForward

open fun fastForward(): Unit

getBufferedPosition

open fun getBufferedPosition(): Long

getCurrentPosition

open fun getCurrentPosition(): Long

getDuration

open fun getDuration(): Long

getMediaArt

open fun getMediaArt(context: Context!): Drawable!

Get current media's drawable art.

Return
Drawable!: Drawable art of current media.

getMediaController

open fun getMediaController(): MediaControllerCompat!

Return the object of MediaControllerCompat from this class.

Return
MediaControllerCompat!: Media Controller Compat object owned by this class.

getMediaSubtitle

open fun getMediaSubtitle(): CharSequence!

Get current media's subtitle.

Return
CharSequence!: Subtitle of current media.

getMediaTitle

open fun getMediaTitle(): CharSequence!

Get current media's title.

Return
CharSequence!: Title of current media.

getSupportedActions

open fun getSupportedActions(): Long

isPlaying

open fun isPlaying(): Boolean

next

open fun next(): Unit

onAttachedToHost

open fun onAttachedToHost(host: PlaybackGlueHost!): Unit

onDetachedFromHost

open fun onDetachedFromHost(): Unit

pause

open fun pause(): Unit

play

open fun play(): Unit

previous

open fun previous(): Unit

rewind

open fun rewind(): Unit

seekTo

open fun seekTo(positionInMs: Long): Unit

setProgressUpdatingEnabled

open fun setProgressUpdatingEnabled(enabled: Boolean): Unit

setRepeatAction

open fun setRepeatAction(repeatActionIndex: Int): Unit

setShuffleAction

open fun setShuffleAction(shuffleActionIndex: Int): Unit