public interface

PlayerNotificationManager.MediaDescriptionAdapter

 androidx.media3.session.PlayerNotificationManager.MediaDescriptionAdapter

Subclasses:

DefaultMediaDescriptionAdapter

Overview

An adapter to provide content assets of the media currently playing.

Summary

Methods
public java.lang.CharSequencegetCurrentContentText(MediaSession session)

Gets the content text for the current media item.

public java.lang.CharSequencegetCurrentContentTitle(MediaSession session)

Gets the content title for the current media item.

public BitmapgetCurrentLargeIcon(MediaSession session, PlayerNotificationManager.BitmapCallback callback)

Gets the large icon for the current media item.

public java.lang.CharSequencegetCurrentSubText(MediaSession session)

Gets the content sub text for the current media item.

Methods

public java.lang.CharSequence getCurrentContentTitle(MediaSession session)

Gets the content title for the current media item.

See .

Parameters:

session: The MediaSession for which a notification is being built.

Returns:

The content title for the current media item.

public java.lang.CharSequence getCurrentContentText(MediaSession session)

Gets the content text for the current media item.

See .

Parameters:

session: The MediaSession for which a notification is being built.

Returns:

The content text for the current media item, or null if no context text should be displayed.

public java.lang.CharSequence getCurrentSubText(MediaSession session)

Gets the content sub text for the current media item.

See .

Parameters:

session: The MediaSession for which a notification is being built.

Returns:

The content subtext for the current media item, or null if no subtext should be displayed.

public Bitmap getCurrentLargeIcon(MediaSession session, 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 .

Parameters:

session: The MediaSession for which a notification is being built.
callback: A PlayerNotificationManager.BitmapCallback to provide a Bitmap asynchronously.

Returns:

The large icon for the current media item, or null if the icon will be returned through the PlayerNotificationManager.BitmapCallback or if no icon should be displayed.