Interface MediaSessionConnector.CustomActionProvider

  • All Known Implementing Classes:
    RepeatModeActionProvider
    Enclosing class:
    MediaSessionConnector

    public static interface MediaSessionConnector.CustomActionProvider
    Provides a PlaybackStateCompat.CustomAction to be published and handles the action when sent by a media controller.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      android.support.v4.media.session.PlaybackStateCompat.CustomAction getCustomAction​(Player player)
      Returns a PlaybackStateCompat.CustomAction which will be published to the media session by the connector or null if this action should not be published at the given player state.
      void onCustomAction​(Player player, String action, Bundle extras)
      Called when a custom action provided by this provider is sent to the media session.
    • Method Detail

      • onCustomAction

        void onCustomAction​(Player player,
                            String action,
                            @Nullable
                            Bundle extras)
        Called when a custom action provided by this provider is sent to the media session.
        Parameters:
        player - The player connected to the media session.
        action - The name of the action which was sent by a media controller.
        extras - Optional extras sent by a media controller, may be null.
      • getCustomAction

        @Nullable
        android.support.v4.media.session.PlaybackStateCompat.CustomAction getCustomAction​(Player player)
        Returns a PlaybackStateCompat.CustomAction which will be published to the media session by the connector or null if this action should not be published at the given player state.
        Parameters:
        player - The player connected to the media session.
        Returns:
        The custom action to be included in the session playback state or null.