Package com.castlabs.sdk.mediasession
Interface SessionCallbackBuilder.CustomCommandProvider
- Enclosing class:
SessionCallbackBuilder
public static interface SessionCallbackBuilder.CustomCommandProvider
Callbacks for querying what custom commands are supported, and for handling a custom command
when a controller sends it.
-
Method Summary
Modifier and TypeMethodDescriptionandroidx.media2.session.SessionCommandGroup
getCustomCommands
(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo) Returns aSessionCommandGroup
with custom commands to publish to the controller, ornull
if no custom commands should be published.androidx.media2.session.SessionResult
onCustomCommand
(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo, androidx.media2.session.SessionCommand customCommand, Bundle args) Called when a controller has sent a custom command.
-
Method Details
-
onCustomCommand
androidx.media2.session.SessionResult onCustomCommand(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo, androidx.media2.session.SessionCommand customCommand, @Nullable Bundle args) Called when a controller has sent a custom command.- Parameters:
session
- The media session.controllerInfo
- TheMediaSession.ControllerInfo
for the controller that sent the custom command.customCommand
- ASessionCommand
from the controller.args
- ABundle
with the extra argument.- See Also:
-
getCustomCommands
@Nullable androidx.media2.session.SessionCommandGroup getCustomCommands(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo) Returns aSessionCommandGroup
with custom commands to publish to the controller, ornull
if no custom commands should be published.- Parameters:
session
- The media session.controllerInfo
- TheMediaSession.ControllerInfo
for the controller that is requesting custom commands.- Returns:
- The custom commands to publish, or
null
if no custom commands should be published.
-