google / google/ExoPlayer

Using androidx.media2.session.SessionToken with PlayerNotificationManager

Open
#9,913 3 comments 3 reactions 1 assignee Claimed by @marcbaechinger View on GitHub
enhancement low priority
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### Using androidx.media2.session.SessionToken with PlayerNotificationManager
I want to get the legacy Media Session Token out of my Code and I started to refactor my code to the Release 2.16.1 and started to use the New Android Media Session androidx.media2.session.SessionToken and while I let Exoplayer manage my Notification, I want away to give the Exoplayer PlayerNotificationManager the new SessionToken as input but it is not Possible

### Proposed solution
is there any adapter to convert the New androidx.media2.session.SessionToken to android.support.v4.media.session.MediaSessionCompat or any way to let PlayerNotificationManager manage my androidx.media2.session.SessionToken?

```java
// at the next line i need to give androidx.media2.session.SessionToken as Input
public final void setMediaSessionToken(**MediaSessionCompat.Token** token) {
if (!Util.areEqual(this.mediaSessionToken, token)) {
mediaSessionToken = token;
invalidate();
}
}
```

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.