Package com.castlabs.sdk.mediasession
Class SessionCallbackBuilder.MediaIdMediaItemProvider
java.lang.Object
com.castlabs.sdk.mediasession.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
-
Method Summary
Modifier and TypeMethodDescriptionandroidx.media2.common.MediaItem
onCreateMediaItem
(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo, String mediaId) Called whenMediaSession.SessionCallback.onCreateMediaItem(MediaSession, ControllerInfo, String)
is called.
-
Constructor Details
-
MediaIdMediaItemProvider
public MediaIdMediaItemProvider()
-
-
Method Details
-
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 whenMediaSession.SessionCallback.onCreateMediaItem(MediaSession, ControllerInfo, String)
is called.- Specified by:
onCreateMediaItem
in interfaceSessionCallbackBuilder.MediaItemProvider
- Parameters:
session
- The media session.controllerInfo
- TheMediaSession.ControllerInfo
for the controller that has requested to create the item.- Returns:
- A new
MediaItem
thatSessionPlayerConnector
can play. - See Also:
-