Interface PlayerNotificationManager.MediaDescriptionAdapter

  • Enclosing class:
    PlayerNotificationManager

    public static interface PlayerNotificationManager.MediaDescriptionAdapter
    An adapter to provide content assets of the media currently playing.
    • Method Detail

      • getCurrentContentTitle

        CharSequence getCurrentContentTitle​(Player player)
        Gets the content title for the current media item.

        See NotificationCompat.Builder.setContentTitle(CharSequence).

        Parameters:
        player - The Player for which a notification is being built.
      • createCurrentContentIntent

        @Nullable
        PendingIntent createCurrentContentIntent​(Player player)
        Creates a content intent for the current media item.

        See NotificationCompat.Builder.setContentIntent(PendingIntent).

        Parameters:
        player - The Player for which a notification is being built.
      • getCurrentContentText

        @Nullable
        CharSequence getCurrentContentText​(Player player)
        Gets the content text for the current media item.

        See NotificationCompat.Builder.setContentText(CharSequence).

        Parameters:
        player - The Player for which a notification is being built.
      • getCurrentSubText

        @Nullable
        default CharSequence getCurrentSubText​(Player player)
        Gets the content sub text for the current media item.

        See NotificationCompat.Builder.setSubText(CharSequence).

        Parameters:
        player - The Player for which a notification is being built.
      • getCurrentLargeIcon

        @Nullable
        Bitmap getCurrentLargeIcon​(Player player,
                                   PlayerNotificationManager.BitmapCallback callback)
        Gets the large icon for the current media item.

        When a bitmap needs to be loaded asynchronously, a placeholder bitmap (or null) should be returned. The actual bitmap should be passed to the PlayerNotificationManager.BitmapCallback once it has been loaded. Because the adapter may be called multiple times for the same media item, bitmaps should be cached by the app and returned synchronously when possible.

        See NotificationCompat.Builder.setLargeIcon(Bitmap).

        Parameters:
        player - The Player for which a notification is being built.
        callback - A PlayerNotificationManager.BitmapCallback to provide a Bitmap asynchronously.