google / google/ExoPlayer

AOD (Always on Display) shows "No Title" when using MediaSessionConnector(mediaSession)

Open
#10,794 1 comment 0 reactions 1 assignee Claimed by @marcbaechinger View on GitHub
needs triage question
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

I am using a foreground service to manage my player and so far everything seems to be working as expected except for one thing.

When the player is playing a media item, the Always on Display shows our icon with "No Title". Am I missing something, or doing things out of order? This is on Android 13 on a Pixel 7 Pro.

```
player = new ExoPlayer.Builder(getApplicationContext()).build();
mediaSession = new MediaSessionCompat(getApplicationContext(), TAG);
MediaSessionConnector mediaSessionConnector = new MediaSessionConnector(mediaSession);
mediaSessionConnector.setPlayer(player);
mediaSession.setActive(true);

player.setAudioAttributes(mAudioAttributes, /* handleAudioFocus= */ true);
player.setPauseAtEndOfMediaItems(true);
notificationManager = new PlayerNotificationManager.Builder(this, notificationId, channelId)
.setNotificationListener(notificationListener)
.setMediaDescriptionAdapter(descriptionAdapter)
.setChannelNameResourceId(R.string.app_name)
.build();
notificationManager.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
notificationManager.setPlayer(player);
notificationManager.setPriority(NotificationCompat.PRIORITY_MAX);
notificationManager.setUseRewindAction(false);
notificationManager.setUseFastForwardAction(false);
notificationManager.setUseChronometer(true);
notificationManager.setSmallIcon(R.drawable.blb_reverse_icon);
notificationManager.setMediaSessionToken(mediaSession.getSessionToken());

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.