-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Question] How to customize responses to headset media buttons? #5179
Comments
Tentatively marking as an enhancement to expose events but @marcbaechinger can advise if there's already a way to do this. |
Yes, it's right that we need to replace a callback which has already been set. There is no other way. The current default implementation provided by the framwork just delegates these calls to the appropriate onXYZ actions. This means playback events coming from the headset are delegated and should work. There is however, no way to intercept such events or distinguish between playback events coming from media buttons or from elswhere in the app. We need to give that a think to provide proper ways to to that. |
…ventHandler Issue #5179 PiperOrigin-RevId: 234571837
Typically I would extend MediaSessionCompat.Callback() and put my logic in onMediaButtonEvent.
When I use setPlayer(), the callback is completely removed and an internal callback is put in place, which I cannot (find a way to) modify.
How can I do that or what is an alternative solution to overriding responses to media buttons using exoPlayer?
The text was updated successfully, but these errors were encountered: