
These legacy callbacks are currently forwarded to onSetMediaUri which will be removed in the future. Also make sure to only call player.prepare/play after the items have been set. The calls to onAddQueueItem are also forwarded to onAddMediaItems to actually allow a session to resolve these items to playable media, which wasn't possible so far. PiperOrigin-RevId: 453625204
Media session demo
This app demonstrates use of media sessions. It's a reference app written in Kotlin, which demonstrates best practices for media apps that want to advertise media sessions.
See the demos README for instructions on how to build and run this demo.