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

MediaPlayerAdapter

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

This implementation extends the PlayerAdapter with a MediaPlayer.

Summary

Public constructors
<init>(context: Context!)

Constructor.

Public methods
open Long

open Long

open Long

MediaPlayer!

Return the MediaPlayer associated with the MediaPlayerAdapter.

open Int

Return updating interval of progress UI in milliseconds.

open Boolean

open Boolean

open Unit

open Unit

open Unit

open Unit

open Unit

Release internal MediaPlayer.

open Unit

Will reset the MediaPlayer and the glue such that a new file can be played.

open Unit
seekTo(newPosition: Long)

open Boolean

Sets the media source of the player witha given URI.

open Unit

Protected methods
open Boolean
onError(what: Int, extra: Int)

Called to indicate an error.

open Boolean
onInfo(what: Int, extra: Int)

Called to indicate an info or a warning.

open Unit

Called to indicate the completion of a seek operation.

Inherited functions

Public constructors

<init>

MediaPlayerAdapter(context: Context!)

Constructor.