mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

This change fixes two bugs where MediaSessionServe shows a notification with the Play icon but tapping it will not start playback: 1. After playback ends: we need to seek to the beginning of the media item. 2. After adding media items to the player but not starting playback: We need to call Player.prepare() too. PiperOrigin-RevId: 432469953 (cherry picked from commit 1023b9d55efe8f0470c5f3b75cd84e40860f79be)
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.