Google 致力于为黑人社区推动种族平等。查看具体举措

MediaBrowserCompat

class MediaBrowserCompat
kotlin.Any
   ↳ android.support.v4.media.MediaBrowserCompat

Browses media content offered by a MediaBrowserServiceCompat.

This object is not thread-safe. All calls should happen on the thread on which the browser was constructed.

All callback methods will be called from the thread on which the browser was constructed.

Summary

Nested classes

Callbacks for connection related events.

abstract

Callback for receiving the result of sendCustomAction.

abstract

Callback for receiving the result of getItem.

A class with information on a single media item for use in browsing/searching media.

abstract

Callback for receiving the result of search.

abstract

Callbacks for subscription related events.

Constants

static String

Predefined custom action to ask the connected service to download a specific MediaItem for offline playback.

static String

Predefined custom action to ask the connected service to remove the downloaded file of MediaItem by the download action.

static String

Used as a float extra field to denote the current progress during download.

static String

Used as a string extra field to denote the target MediaItem.

static String

Used as an int extra field to denote the page number to subscribe.

static String

Used as an int extra field to denote the number of media items in a page.

Public constructors

<init>(context: Context!, serviceComponent: ComponentName!, callback: MediaBrowserCompat.ConnectionCallback!, rootHints: Bundle!)

Creates a media browser for the specified media browse service.

Public methods

Unit

Connects to the media browse service.

Unit

Disconnects from the media browse service.

Bundle?

Gets any extras for the media service.

Unit
getItem(@NonNull mediaId: String, @NonNull cb: MediaBrowserCompat.ItemCallback)

Retrieves a specific MediaItem from the connected service.

String

Gets the root id.

ComponentName

Gets the service component that the media browser is connected to.

MediaSessionCompat.Token

Gets the media session token associated with the media browser.

Boolean

Returns whether the browser is connected to the service.

Unit
search(@NonNull query: String, extras: Bundle!, @NonNull callback: MediaBrowserCompat.SearchCallback)

Searches media items from the connected service.

Unit
sendCustomAction(@NonNull action: String, extras: Bundle!, @Nullable callback: MediaBrowserCompat.CustomActionCallback?)

Sends a custom action to the connected service.

Unit
subscribe(@NonNull parentId: String, @NonNull callback: MediaBrowserCompat.SubscriptionCallback)

Queries for information about the media items that are contained within the specified id and subscribes to receive updates when they change.

Unit
subscribe(@NonNull parentId: String, @NonNull options: Bundle, @NonNull