media
media copied to clipboard
How to show playback notification for basic player implementation
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.
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.