MediaLibraryService.MediaLibrarySession.MediaLibrarySessionCallback

public static class MediaLibraryService.MediaLibrarySession.MediaLibrarySessionCallback
extends MediaSession.SessionCallback

java.lang.Object
   ↳ androidx.media2.session.MediaSession.SessionCallback
     ↳ androidx.media2.session.MediaLibraryService.MediaLibrarySession.MediaLibrarySessionCallback


Callback for the MediaLibraryService.MediaLibrarySession.

When you return LibraryResult with media items, items must have valid MediaMetadata.METADATA_KEY_MEDIA_ID and specify MediaMetadata.METADATA_KEY_BROWSABLE and MediaMetadata.METADATA_KEY_PLAYABLE.

Summary

Public constructors

MediaLibrarySessionCallback()

Public methods

LibraryResult onGetChildren(MediaLibraryService.MediaLibrarySession session, MediaSession.ControllerInfo controller, String parentId, int page, int pageSize, MediaLibraryService.LibraryParams params)

Called to get children of given parent id.

LibraryResult onGetItem(MediaLibraryService.MediaLibrarySession session, MediaSession.ControllerInfo controller, String mediaId)

Called to get an item.

LibraryResult onGetLibraryRoot(MediaLibraryService.MediaLibrarySession session, MediaSession.ControllerInfo controller, MediaLibraryService.LibraryParams params)

Called to get the root information for browsing by a MediaBrowser.

LibraryResult onGetSearchResult(MediaLibraryService.MediaLibrarySession session, MediaSession.ControllerInfo controller, String query, int page, int pageSize, MediaLibraryService.LibraryParams params)

Called to get the search result.

int onSearch(MediaLibraryService.MediaLibrarySession session, MediaSession.ControllerInfo controller, String query, MediaLibraryService.LibraryParams params)

Called when a controller requests search.

int onSubscribe(MediaLibraryService.MediaLibrarySession session, MediaSession.ControllerInfo controller, String parentId, MediaLibraryService.LibraryParams params)

Called when a controller subscribes to the parent.

int onUnsubscribe(MediaLibraryService.MediaLibrarySession session, MediaSession.ControllerInfo controller, String parentId)

Called when a controller unsubscribes to the parent.

Inherited methods