-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you intercept commands with a ForwardingPlayer
?
#1026
Comments
I did some more debugging and it turns out the mappings from controller calls to player calls are not one-to-one and there is no mapping in the docs: https://developer.android.com/reference/androidx/media3/session/MediaController#setMediaItem(androidx.media3.common.MediaItem) In particular, override fun setMediaItems(mediaItems: MutableList<MediaItem>, resetPosition: Boolean) {
super.setMediaItems(mediaItems, resetPosition)
} I think this is an issue because if I override what commands are available (which are overridden in some circumstances for some reason), I expect to be able to know which ForwardingPlayer overrides I will need to provide for said command for the custom behaviors of my app. Are the mappings for this type of thing documented somewhere? Are they consistent? Are these subject to change? |
We attempt to call the same
All these command codes fully list the methods that need to be implemented for this code. Example: https://developer.android.com/reference/androidx/media3/common/Player#COMMAND_SET_SPEED_AND_PITCH() explains how |
Thank you so much for the explanation! That page looks like a fantastic resource for this. |
It seemed pretty straightforward to me, but it is not working as expected.
I have a
MediaBrowser
that I am using as aMediaController
for aMediaLibraryService.MediaLibrarySession
I set up the
ForwardingPlayer
like soThe command methods do get called, but
COMMAND_SEEK_TO_NEXT_MEDIA_ITEM
is not always available to the controller.Then when the controller method
setMediaItem
is called, theMyPlayer.setMediaItem
method is not called.This issue I made earlier has more details:
#1021
The text was updated successfully, but these errors were encountered: