Closed DavidEdwardsBL closed 1 month ago
Thanks for your question!
This will be included in the beta of 1.4.0.
The media1 session has an additional extras Bundle
in the PlaybackStateCompat
that doesn't exist in Media3. 1.4.0 will propagate the already existing session extras to the PlaybackStateCompat
as well.
So with 1.4 (starting with beta) you can populate the extras Bundle
with the keys above and then call:
mediaLibrarySession.mediaNotificationControllerInfo?.let {
val extras = Bundle()
extras.putBoolean(MediaConstants.EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_NEXT, true)
extras.putBoolean(MediaConstants.EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_PREV, true)
mediaLibrarySession.setSessionExtras(it, extras)
}
This will propagate the extras to the session extras and the PlaybackStateCompat.extras
from where System UI reads them.
Once this is released, the documentation will be updated accordingly. I'll leave this issue open to track this.
This is implemented with commit 2456669398100730737ea5ef538c62c30a53e05b and is available in 1.4.0.
The properties of the session extras are propagated into the PlaybackState(Compat)
of the legacy/platform session where System UI can read them:
mediaLibrarySession.mediaNotificationControllerInfo?.let {
val extras = Bundle()
extras.putBoolean(MediaConstants.EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_NEXT, true)
extras.putBoolean(MediaConstants.EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_PREV, true)
mediaLibrarySession.setSessionExtras(it, extras)
}
@marcbaechinger Is that designed to have an impact on Android Auto?
The buttons appear correct now in standard notifications. However, it does not seem to work correctly in Android Auto.
it does not seem to work correctly in Android Auto.
Can you clarify what your expectation is for for Android Auto? Can you point me to the docs of Android Auto that tell how they deal with for instance MediaConstants.EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_NEXT
, like expected behaviour vs. observed behaviour?
Split from: https://github.com/androidx/media/issues/216
There are flags I would like to set: [EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_PREV](https://developer.android.com/reference/androidx/media3/session/MediaConstants#EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_PREV()) and [EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_NEXT](https://developer.android.com/reference/androidx/media3/session/MediaConstants#EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_NEXT()).
In the documentation they are listed as
(not yet supported with Media3)
. Is there a timeframe for their implementation?