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 |
abstract |
Callback for receiving the result of |
A class with information on a single media item for use in browsing/searching media. |
|
abstract |
Callback for receiving the result of |
abstract |
Callbacks for subscription related events. |
Constants |
|
---|---|
static String |
Predefined custom action to ask the connected service to download a specific |
static String |
Predefined custom action to ask the connected service to remove the downloaded file of |
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 |
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 |
connect() 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 |
String |
getRoot() 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 |
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 callback: MediaBrowserCompat.SubscriptionCallback) Queries with service-specific arguments for information about the media items that are contained within the specified id and subscribes to receive updates when they change. |
Unit |
unsubscribe(@NonNull < |