Package com.google.android.exoplayer2.ext.media2

## Class SessionCallbackBuilder.MediaIdMediaItemProvider

- java.lang.Object
- - com.google.android.exoplayer2.ext.media2.SessionCallbackBuilder.MediaIdMediaItemProvider

- All Implemented Interfaces:
    `SessionCallbackBuilder.MediaItemProvider`
  Enclosing class:
    SessionCallbackBuilder

      public static final class SessionCallbackBuilder.MediaIdMediaItemProvider
      extends Object
      implements SessionCallbackBuilder.MediaItemProvider

  A `SessionCallbackBuilder.MediaItemProvider` that creates media items containing only a media ID.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MediaIdMediaItemProvider()` |

  - ### Method Summary

    All Methods Instance Methods Concrete 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MediaIdMediaItemProvider

          public MediaIdMediaItemProvider()

  - ### Method Detail

    - #### onCreateMediaItem

          @Nullable
          public androidx.media2.common.MediaItem onCreateMediaItem​(androidx.media2.session.MediaSession session,
                                                                    androidx.media2.session.MediaSession.ControllerInfo controllerInfo,
                                                                    String mediaId)

      Description copied from interface: `SessionCallbackBuilder.MediaItemProvider`
      Called when `MediaSession.SessionCallback.onCreateMediaItem(MediaSession, ControllerInfo, String)` is called.
      Specified by:
        `onCreateMediaItem` in interface `SessionCallbackBuilder.MediaItemProvider`
      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)`