MediaControllerGlue
abstract class MediaControllerGlue : PlaybackControlGlue
| kotlin.Any | |||
| ↳ | androidx.leanback.media.PlaybackGlue | ||
| ↳ | androidx.leanback.media.PlaybackControlGlue | ||
| ↳ | androidx.leanback.media.MediaControllerGlue |
A helper class for implementing a glue layer for MediaControllerCompat.
Summary
Public constructors |
|---|
Constructor for the glue. |
Public functions |
|
|---|---|
Unit |
Attaches to the given media controller. |
Unit |
Detaches from the media controller. |
Int |
Returns the current position of the media item in milliseconds. |
Int |
Returns the current playback speed. |
Drawable! |
Returns a bitmap of the art for the media item. |
MediaControllerCompat! |
Returns the media controller currently attached. |
Int |
Returns the duration of the media item in milliseconds. |
CharSequence! |
Returns the subtitle of the media item. |
CharSequence! |
Returns the title of the media item. |
Long |
Returns a bitmask of actions supported by the media player. |
Boolean |
Returns true if there is a valid media item. |
Boolean |
Returns true if media is currently playing. |
Unit |
Goes to the next media item. |
Unit |
Pauses the media player. |
Unit |
Start playback at the given speed. |
Unit |
Goes to the previous media item. |
Inherited Constants |
||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited functions |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Public constructors
MediaControllerGlue(
context: Context!,
fastForwardSpeeds: IntArray!,
rewindSpeeds: IntArray!
)
Constructor for the glue.
Public functions
funattachToMediaController(mediaController: MediaControllerCompat!): Unit
Attaches to the given media controller.
fundetach(): Unit
Detaches from the media controller. Must be called when the object is no longer needed.
getCurrentPosition
fungetCurrentPosition(): Int
Returns the current position of the media item in milliseconds.
getCurrentSpeedId
fungetCurrentSpeedId(): Int
Returns the current playback speed. When playing normally, PLAYBACK_SPEED_NORMAL should be returned.
getMediaDuration
fungetMediaDuration(): Int
Returns the duration of the media item in milliseconds.
getSupportedActions
fungetSupportedActions(): Long
Returns a bitmask of actions supported by the media player.
play
funplay(speed: Int): Unit
Start playback at the given speed.
| Parameters | |
|---|---|
speed: Int |
The desired playback speed. For normal playback this will be |