MediaBrowser
class MediaBrowser : MediaController
Browses media content offered by a MediaLibraryService in addition to the MediaController functions.
Summary
Nested types |
|---|
class MediaBrowser.BuilderA builder for |
interface MediaBrowser.Listener : MediaController.ListenerA listener for events from |
Public functions |
|
|---|---|
ListenableFuture<LibraryResult<ImmutableList<MediaItem!>!>!>! |
getChildren(Returns the children under a parent id. |
ListenableFuture<LibraryResult<MediaItem!>!>! |
Returns the media item with the given media id. |
ListenableFuture<LibraryResult<MediaItem!>!>! |
Returns the library root item. |
ListenableFuture<LibraryResult<ImmutableList<MediaItem!>!>!>! |
getSearchResult(Returns the search result from the library service. |
ListenableFuture<LibraryResult<Void!>!>! |
search(query: String!, params: MediaLibraryService.LibraryParams?)Requests a search from the library service. |
ListenableFuture<LibraryResult<Void!>!>! |
subscribe(parentId: String!, params: MediaLibraryService.LibraryParams?)Subscribes to a parent id for changes to its children. |
ListenableFuture<LibraryResult<Void!>!>! |
unsubscribe(parentId: String!)Unsubscribes from a parent id for changes to its children, which was previously subscribed by |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Inherited functions |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public functions
getChildren
fun getChildren(
parentId: String!,
page: @IntRange(from = 0) Int,
pageSize: @IntRange(from = 1) Int,
params: MediaLibraryService.LibraryParams?
): ListenableFuture<LibraryResult<ImmutableList<MediaItem!>!>!>!
Returns the children under a parent id.
If it's successfully completed, value will have the children.
| Parameters | |
|---|---|
parentId: String! |
A non-empty parent id for getting the children. |
page: @IntRange(from = 0) Int |
A page number to get the paginated result starting from |
pageSize: @IntRange(from = 1) Int |
A page size to get the paginated result. Should be greater than |
params: MediaLibraryService.LibraryParams? |
Optional parameters. |
| Returns | |
|---|---|
ListenableFuture<LibraryResult<ImmutableList<MediaItem!>!>!>! |
A |
getItem
fun getItem(mediaId: String!): ListenableFuture<LibraryResult<MediaItem!>!>!
Returns the media item with the given media id.
If it's successfully completed, value will have the media item.
| Parameters | |
|---|---|
mediaId: String! |
A non-empty media id. |
| Returns | |
|---|---|
ListenableFuture<LibraryResult<MediaItem!>!>! |
A |
getLibraryRoot
fun getLibraryRoot(params: MediaLibraryService.LibraryParams?): ListenableFuture<LibraryResult<MediaItem!>!>!
Returns the library root item.
If it's successfully completed, value will have the library root item.
| Parameters | |
|---|---|
params: MediaLibraryService.LibraryParams? |
The optional parameters for getting library root item. |
| Returns | |
|---|---|
ListenableFuture<LibraryResult<MediaItem!>!>! |
A |
getSearchResult
fun getSearchResult(
query: String!,
page: @IntRange(from = 0) Int,
pageSize: @IntRange(from = 1) Int,
params: MediaLibraryService.LibraryParams?
): ListenableFuture<LibraryResult<ImmutableList<MediaItem!>!>!>!
Returns the search result from the library service.
If it's successfully completed, value will have the search result.
| Parameters | |
|---|---|
query: String! |
A non-empty search query that you've specified with |
page: @IntRange(from = 0) Int |
A page number to get the paginated result starting from |
pageSize: @IntRange(from = 1) Int |
A page size to get the paginated result. Should be greater than |
params: MediaLibraryService.LibraryParams? |
Optional parameters. |
| Returns | |
|---|---|
ListenableFuture<LibraryResult<ImmutableList<MediaItem!>!>!>! |
A |
search
fun search(query: String!, params: MediaLibraryService.LibraryParams?): ListenableFuture<LibraryResult<Void!>!>!
Requests a search from the library service.
Returned LibraryResult will only tell whether the attempt to search was successful. For getting the search result, listen to onSearchResultChanged and call getSearchResult}.
| Parameters | |
|---|---|
query: String! |
A non-empty search query. |
params: MediaLibraryService.LibraryParams? |
Optional parameters. |
| Returns | |
|---|---|
ListenableFuture<LibraryResult<Void!>!>! |
A |
subscribe
fun subscribe(parentId: String!, params: MediaLibraryService.LibraryParams?): ListenableFuture<LibraryResult<Void!>!>!
Subscribes to a parent id for changes to its children. When there's a change, onChildrenChanged will be called with the LibraryParams. You may call getChildren to get the children.
| Parameters | |
|---|---|
parentId: String! |
A non-empty parent id to subscribe to. |
params: MediaLibraryService.LibraryParams? |
Optional parameters. |
| Returns | |
|---|---|
ListenableFuture<LibraryResult<Void!>!>! |
A |
unsubscribe
fun unsubscribe(parentId: String!): ListenableFuture<LibraryResult<Void!>!>!
Unsubscribes from a parent id for changes to its children, which was previously subscribed by subscribe.
This unsubscribes from all previous subscriptions with the parent id, regardless of the LibraryParams that was previously given.
| Parameters | |
|---|---|
parentId: String! |
A non-empty parent id to unsubscribe from. |
| Returns | |
|---|---|
ListenableFuture<LibraryResult<Void!>!>! |
A |