You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developping a launcher that displays a "Now Playing" section.
For now, I'm using the platform Media Session (getActiveSessions along with addOnActiveSessionsChangedListener).
MediaSessionManager mm = (MediaSessionManager) this.getSystemService(Context.MEDIA_SESSION_SERVICE);
ComponentName componentName = new ComponentName(this, NotificationListener.class);
List<MediaController> controllers = mm.getActiveSessions(componentName)
I can then iterate on the controllers to decide what to display.
Is there a way of reaching the same goal using the media3 lib ?
I tried using SessionToken.getAllServiceTokens() and then build a MediaController for each of them, but not all media apps return service tokens in this method (for example Youtube is missing).
The text was updated successfully, but these errors were encountered:
Yeah, there are some rough edges still. Please see #171 also.
The sessions returned by getAllServiceTokens are only tokens from apps that are using a service. Without knowing, it looks like YT probably doesn't use a service on this device which sounds plausible for a TV environment.
I think what you can do is convert the token to a Media3 session token with SessionToken.createSessionToken(Context context, MediaSessionCompat.Token compatToken) and then build a MediaController with it.
Please let us know if you find some further use cases that do not yet seamlessly work in this area, so we can collect this and then fix for a future release.
I'm developping a launcher that displays a "Now Playing" section.
For now, I'm using the platform Media Session (
getActiveSessions
along withaddOnActiveSessionsChangedListener
).I can then iterate on the controllers to decide what to display.
Is there a way of reaching the same goal using the media3 lib ?
I tried using
SessionToken.getAllServiceTokens()
and then build a MediaController for each of them, but not all media apps return service tokens in this method (for example Youtube is missing).The text was updated successfully, but these errors were encountered: