media icon indicating copy to clipboard operation
media copied to clipboard

How to show playback notification for basic player implementation

Open Debayudh opened this issue 9 months ago • 1 comments

Is there a way to show the playback notification for basic player implementation without having to implement MediaSessionService and all? I think this was possible in exoplayer with PlayerNotificationManager, but it seems that does not work in media3.

Debayudh avatar May 11 '24 20:05 Debayudh

Sorry for my late response.

There is still a PlayerNotificationManager available in the UI module. Have you tried using this? The notification may look a bit different than what is provided by the DefaultMediaNotificationProvider. However, starting with API 32 the UMO will be displayed instead of the notification.

You need to set the platform session token with setSessionToken(MediaSession.Token)? You can get the platform token by calling session.getPlatformToken() to get that token.

Let me know whether this works for you if you try.

marcbaechinger avatar May 22 '24 13:05 marcbaechinger