
Media button event coming from the `MediaSessionService` are delegated to the `MediaSessionImpl` and then sent to the session by using the `MediaSessionStub` directly instead of using the `MediaController` API. Splitting the `MediaController.Listener` and `Player.Listener` in `MediaNotificationManager` got reverted, and both listener are set to the controller as before. This reverts the change that introduced a different timing behaviour. It still holds, that a listener registered on a `MediaController` that calls a method like `play()` is called immediately and before the call has arrived at the player. This change works around this behaviour from the library side by calling `MediaSessionStub` directly with a `ControllerInfo`. #minor-release PiperOrigin-RevId: 573918850
Session module
This module provides media session functionality through which media information and controls can be exposed to the Android platform, as well as to other processes and applications.
Getting the module
The easiest way to get the module is to add it as a gradle dependency:
implementation 'androidx.media3:media3-session:1.X.X'
where 1.X.X
is the version, which must match the version of the other media
modules being used.
Alternatively, you can clone this GitHub project and depend on the module locally. Instructions for doing this can be found in the top level README.