Android 12 Developer Preview is here! Try it out, and give us your feedback!

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.

ge