Interface MediaSessionConnector.PlaybackPreparer

    • Method Detail

      • getSupportedPrepareActions

        long getSupportedPrepareActions()
        Returns the actions which are supported by the preparer. The supported actions must be a bitmask combined out of PlaybackStateCompat.ACTION_PREPARE, PlaybackStateCompat.ACTION_PREPARE_FROM_MEDIA_ID, PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH, PlaybackStateCompat.ACTION_PREPARE_FROM_URI, PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID, PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH and PlaybackStateCompat.ACTION_PLAY_FROM_URI.
        Returns:
        The bitmask of the supported media actions.
      • onPrepare

        void onPrepare​(boolean playWhenReady)
        See MediaSessionCompat.Callback.onPrepare().
        Parameters:
        playWhenReady - Whether playback should be started after preparation.
      • onPrepareFromMediaId

        void onPrepareFromMediaId​(String mediaId,
                                  boolean playWhenReady,
                                  @Nullable
                                  Bundle extras)
        See MediaSessionCompat.Callback.onPrepareFromMediaId(String, Bundle).
        Parameters:
        mediaId - The media id of the media item to be prepared.
        playWhenReady - Whether playback should be started after preparation.
        extras - A Bundle of extras passed by the media controller, may be null.
      • onPrepareFromSearch

        void onPrepareFromSearch​(String query,
                                 boolean playWhenReady,
                                 @Nullable
                                 Bundle extras)
        See MediaSessionCompat.Callback.onPrepareFromSearch(String, Bundle).
        Parameters:
        query - The search query.
        playWhenReady - Whether playback should be started after preparation.
        extras - A Bundle of extras passed by the media controller, may be null.
      • onPrepareFromUri

        void onPrepareFromUri​(Uri uri,
                              boolean playWhenReady,
                              @Nullable
                              Bundle extras)
        See MediaSessionCompat.Callback.onPrepareFromUri(Uri, Bundle).
        Parameters:
        uri - The Uri of the media item to be prepared.
        playWhenReady - Whether playback should be started after preparation.
        extras - A Bundle of extras passed by the media controller, may be null.