Skip to content

Conversation

ddfreiling
Copy link
Contributor

without this command the session-adapter didn't properly report the current timeline to a media3.MediaSession

without this command the session-adapter didn't properly report the current timeline to a media3.MediaSession
@qnga
Copy link
Member

qnga commented Oct 7, 2025

What is timeline used for?

@ddfreiling
Copy link
Contributor Author

ddfreiling commented Oct 7, 2025

If using the ForwardingSimpleBasePlayer to modify MediaSession, it has a getState function to build the player state, which depends on the adapter player allowing the COMMAND_GET_TIMELINE to be called, which currently TtsSessionAdapter does not.
Screenshot 2025-10-07 at 13 57 15

@qnga
Copy link
Member

qnga commented Oct 7, 2025

I understand that. But what does this getState do better with the timeline? I'm not entirely sure my timeline implementation is good or useful in the adapter, that's why I ask.

@ddfreiling
Copy link
Contributor Author

ddfreiling commented Oct 7, 2025

Without a timeline the SimpleBasePlayer dies on an assert that timeline must not be empty if the player is not in IDLE state. For us this crashes the entire MediaSession when we call openSession on it with a TtsNavigator.

Exception:

SimpleBasePlayer: Empty playlist only allowed in STATE_IDLE or STATE_ENDED

As long as SimpleBasePlayer sees a non-empty timeline, everything seems to work.

I guess this only happens, since we wrap the navigator.asMedia3Player() in a ForwardingSimpleBasePlayer to better control certain media-button events and notification button layout. Maybe there's another way to do this?

@qnga
Copy link
Member

qnga commented Oct 7, 2025

Ok, I see. If you want a specific notification button layout, you might expect a better timeline than my shitty one. Are you expecting resource-based navigation in the notification? I might have not exposed it because of the notification actually, I need to check.

@qnga
Copy link
Member

qnga commented Oct 7, 2025

As far as I understand and remember the missing timeline command is more of a feature than a bug. To prevent your crash you should be able to provide a timeline by yourself by overriding getState or something of that ilk. If for some some reason that's not enough, please report your use case in detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants