Interface SessionCallbackBuilder.MediaItemProvider

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      androidx.media2.common.MediaItem onCreateMediaItem​(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo, String mediaId)
      Called when MediaSession.SessionCallback.onCreateMediaItem(MediaSession, ControllerInfo, String) is called.
    • Method Detail

      • onCreateMediaItem

        @Nullable
        androidx.media2.common.MediaItem onCreateMediaItem​(androidx.media2.session.MediaSession session,
                                                           androidx.media2.session.MediaSession.ControllerInfo controllerInfo,
                                                           String mediaId)
        Called when MediaSession.SessionCallback.onCreateMediaItem(MediaSession, ControllerInfo, String) is called.
        Parameters:
        session - The media session.
        controllerInfo - The MediaSession.ControllerInfo for the controller that has requested to create the item.
        Returns:
        A new MediaItem that SessionPlayerConnector can play.
        See Also:
        MediaSession.SessionCallback.onCreateMediaItem(MediaSession, ControllerInfo, String), MediaController.addPlaylistItem(int, String), MediaController.replacePlaylistItem(int, String), MediaController.setMediaItem(String), MediaController.setPlaylist(List, MediaMetadata)